embed element

Flash movie

The Flash file is taken from Designhulp. You can find it here.

Alternative content. Google and screen readers would read these lines.

JavaScript code

Note that I didn't use a Flash sniffer yet. This is only a test if it is possible to embed Flash using JavaScript.

function createFlashMarkup(width,height,uri,replaceid){

 var embed = document.createElement('embed');
 embed.setAttribute('width',width);
 embed.setAttribute('height',height);
 embed.setAttribute('src',uri);

 var div = document.getElementById(replaceid);
 document.getElementById('body').replaceChild(embed,div); 
}

window.onload = function(){
 createFlashMarkup('550','400','vuurwerk.swf','replaced-by-flash');
}