-
Help with the SWFObject!
Hi there,
Please, can someone help me, how to use the SWFObject for my HTML page that contains 2 flash objects and one media player object .wmv. The standard procedure below work just fine for one flash object, but when i try to use it for multiple objects in one web page, it doesn't work! May be i am missing something or it is just a more complicated code! Please, help! Thanks in advance!
<script type="text/javascript" src="swfobject.js"></script> /in the head of the html page/ and:
<div id="flashcontent">
This text is replaced by the Flash movie.
</div>
<script type="text/javascript">
var so = new SWFObject("movie.swf", "mymovie", "500", "100", "6", "#003399");
so.addVariable("variable", "varvalue");
so.write("flashcontent");
</script>
-
hi,
You don't share all the code, so it's harder to tell, but:
Make sure you use two different ids.
Code:
<script type="text/javascript" src="swfobject.js"></script> /in the head of the html page/ and:
<div id="flashcontent">
This text is replaced by the Flash movie.
</div>
<script type="text/javascript">
var so = new SWFObject("movie.swf", "mymovie", "500", "100", "6", "#003399");
so.addVariable("variable", "varvalue");
so.write("flashcontent");
</script>
<div id="moreflashcontent">
This text is replaced by the Flash movie.
</div>
<script type="text/javascript">
var so = new SWFObject("movie2.swf", "mymovie2", "500", "100", "6", "#003399");
so.write("moreflashcontent");
</script>
-
Thanks, that's a big help, the code itself doesn't differ much from the one shown, because i didn't know what kind of code to use for the second movie on the page!
-
I can't use though the same code for the wmv movie. Do you have any clues? Thanks for the help!
<object id="MediaPlayer" width="344" height="280" classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95" type="application/x-oleobject">
<param name="FileName" value="
http://xxx.wmv">
<param name="autostart" value="1">
<param name="showcontrols" value="1">
<embed type="application/x-mplayer2"
src="xxx.wmv"
width="344"
height="280"
autostart="1"
showcontrols="1"> </embed></object>
-
-
Thanks, very useful article, big help nunomira