자바스크립트로 플래시 무비 삽입하기

embed-element.html:
<html>
<head>
<title>Embedding Flash with JavaScript [embed element]</title>
<script type="text/javascript" src="embed-element.js"></script>
<body>
 <h1><samp>embed</samp> element</h1>
<h2>Flash movie</h2>
<div id="replaced-by-flash">
  <p>Alternative content. Google and screen readers would read these lines.</p>
</div>
</body>
</html>

embed-element.js 내용은 요렇게:
function createFlashMarkup(width,height,uri,replaceid){

var embed = document.createElement('embed');
embed.setAttribute('width',width);
embed.setAttribute('height',height);
embed.setAttribute('src',uri);
embed.setAttribute('wmode', 'transparent');   // 투명한 배경을 원할경우

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

window.onload = function(){
createFlashMarkup('640','480','testMovie.swf','replaced-by-flash');
}



http://blog.nice2seeyou.com/mike/trackback/146
YOUR COMMENT IS THE CRITICAL SUCCESS FACTOR FOR THE QUALITY OF BLOG POST