I was just trying this out yesterday. See the final product using a JS call to load a new FLV file into a Flash movie written with SWFObject here:<br><br><a href="http://www.ClubMax3D.com/animation.cfm" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
www.ClubMax3D.com/animation.cfm
</a> (you might have to enter your email to view the page --- sorry, client request!)<br><br>Once the page loads, the SWFObject is no longer there -- it has written an object or embed tag to place the SWF in the page, and then it's done. So you don't access the SWFObject anymore. (I'm pretty sure -- ?)
<br><br>You can access the swf file by it's id, which is the second parameter in the SWFObject
constructor.<br><br>You can use Flash 8's ExternalInterface to set up a function that you can call with JS from your HTML page. Something like:<br><br>In your HTML page:<br><br><head><br><script type="text/javascript">
<br>var flashVideoPlayer = document.getElementById('video');<br>function callFlashPlayVideo(flv_path) {<br> flashVideoPlayer.playVideo(flv_path);<br>} <br></script><br></head><br><body><br><div id="flashcontent"></div>
<br><script type="text/javascript"><br> // <![CDATA[<br> var so = new SWFObject("spvideo.swf", "video", "781px","522px", "8","" , true);
<br> so.addVariable("flv_path", "flv/video1.flv");<br> so.write("flashcontent");<br> // ]]><br></script><br><a href="#" onclick="callFlashPlayVideo(flv/video2.flv)" > See other movie </a>
<br></body><br><br>And in your Flash file:<br>import flash.external.ExternalInterface;<br>//<br>ExternalInterface.addCallback("playVideo", null, playVideo); <br>//<br>// and then depending on how you're playing the flv
<br>function playVideo(url){<br> ns.play(url);<br>}<br>// then call the first movie to play<br>playVideo(_root.flv_path);<br><br><br><div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>------------------------------<br><br>Does SWFobject support loading vars into flash via a javascript?
<br><br>Im not a programmer, but I hope you get the idea what im asking for.?<br><br><br></blockquote></div><br clear="all"><br>-- <br>Danya Henninger<br><br>Imagic | <a href="http://www.imagicdigital.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
www.imagicdigital.com
</a><br><a href="mailto:danya@imagicdigital.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">danya@imagicdigital.com</a>