I thought I would try using DOM to change flv's inside my .swf. It seems to
work, yet not.
Clicking on the link should "fill" the div with the code for the swf and load
the flv. What I see is a blip (opens and closes in a split second) of it
instead. Is it a browser issue or coding?
(BTW, I'm using Mozilla and IE7 to test.)
HTML code:
<html xmlns="
http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>flv_player</title>
<script language="JavaScript">
swf = "flv_player";
function change_flv(flv){
vid_html = flv;
vid_title = "Dogsitting";
params = "?myVideo="+vid_html+"&vidTitle="+vid_title;
var wc = "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000'
codebase='
http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab# version=8,0,0,0' width='340' height='320' id='"+swf+"' align='middle'>";
wc += "<param name='allowScriptAccess' value='sameDomain' />";
wc += "<param name='"+swf+"' value='"+swf+".swf"+params+"' />";
wc += "<param name='quality' value='high' />";
wc += "<param name='bgcolor' value='#ffffff' />";
wc += "<embed src='"+swf+".swf"+params+"' quality='high' bgcolor='#ffffff'
width='340' height='320' name='"+swf+"' align='middle' swLiveConnect='true'
allowScriptAccess='sameDomain' type='application/x-shockwave-flash'
pluginspage='
http://www.macromedia.com/go/getflashplayer' />";
wc += "</object>";
document.getElementById("flv").innerHTML=wc;
document.title = "FLV Player: "+vid_title;
}
</script>
</head>
<body bgcolor="#ffffff">
<div>
<p>Choose:</p>
<p>· <a href="" name="dogsitting"
onclick="change_flv(name)">dogsitting</a></p>
</div>
<div id="flv">
</div>
</body>
</html>