Adding flash with JavaScript:
The JavaScript with capable to execute the flash file.you need to create a flash file and pass the name of the file as a argument in the parenthesis of the event function.
An example is illustrated here -
Code:
function addFlashObj(node, swf) {
var obj = document.createElement('object');
node.appendChild(obj);
var para = document.createElement('param');
para.setAttribute('name', 'movie');
para.setAttribute('value', swf);
obj.appendChild(para);
obj.setAttribute('data', swf);
obj.setAttribute('type', 'application/x-shockwave-flash');
}
12.
addFlashObj(document.body, 'sample.swf');
Bookmarks