<div>Hi Everyone,</div>
<div> </div>
<div>This isnt a swfObject specific question so i apologise for that fact but...<br><br>I'm trying to build an a flash container swf to perform 2 functions.</div>
<div> </div>
<div>The First:</div>
<div>To have an image loader using the Loader Component in the hopes of changing the contentPath via ExternalInterface</div>
<div> </div>
<div>The Second:</div>
<div>To have a flash video player using the FLVPlayBack Component. Again changing the contentPath via ExternalInterface</div>
<div> </div>
<div>My Problem:</div>
<div>I've added the two components to my library, and created two movie clips, LoaderIMG, and LoaderFLV. Inside each of these MCs is the appropriate component with a set instance name. I only want one component on the screen at once. What i want to achieve is the ability to change the content path of each component externally using the ExternalInterface in Flash 8. Ignoring the fact that my end goal is to use external interface, in the meantime I am currently having trouble figuring out how to change the contentPath of the two loaders. They each only load their origional contentPath values set in the component instances in the Loader MC's I created. I've been experimenting with _root, _parent, and _levels but I'm still not having much luck. If any of you could suggest a fix or an alternative method I would much appreciate it.
</div>
<div> </div>
<div>Thanks alot.</div>
<div> </div>
<div>Actionscript below:</div>
<div> </div>
<div>// This is a gateway to JavaScript via the ExternalInterface (Do i need two - one for each function to be called externally?)<br>var ei1 = flash.external.ExternalInterface.addCallback("loadImages", null, loadImages);
<br>var ei2 = flash.external.ExternalInterface.addCallback("loadVideos", null, loadVideos);</div>
<div>
<p>// Temp for development (Its not loading these paths currently which is what i want to fix)<br>imgPath = "pics/red.gif";<br>vdoPath = "media/test2.flv";<br>trace(imgPath);<br>trace(vdoPath);</p>
<p>// Function to add the FLVplayer MC to the stage when called upon<br>function createLoaderFLV ()<br>{<br> // Call our component from the library<br> attachMovie("loaderFLV", "loaderFLV", 1);<br> // Set its X and Y co-ordinates
<br> loaderFLV._x = 0;<br> loaderFLV._y = 0;<br>}</p>
<p>// Function to add our imgLoader MC to the stage when called upon<br>function createLoaderIMG ()<br>{<br> // Call our component from the library<br> attachMovie("loaderIMG", "loaderIMG", 2);<br> // Set its X and Y co-ordinates
<br> loaderIMG._x = 0;<br> loaderIMG._y = 0;<br>}</p>
<p>// Function to set the contentPath of the images and call createLoaderIMG function to the stage<br>function loadImages (imgPath)<br>{<br> // Remove the loaders from the stage<br> loaderFLV.removeMovieClip();<br> loaderIMG.removeMovieClip
();<br> // Creates instances of the loaders on the stage<br> createLoaderIMG();<br> // Sets the contentPath to that specified externally via php<br> imgContainer.contentPath = imgPath;<br>}</p>
<p>// Function to set the contentPath of the videos and call createLoaderFLV function to the stage<br>function loadVideos (vdoPath)<br>{<br> // Remove the loaders from the stage<br> loaderIMG.removeMovieClip();<br> loaderFLV.removeMovieClip
();<br> // Creates instances of the loaders on the stage<br> createLoaderFLV();<br> // Sets the contentPath to that specified externally via php<br> vdoContainer.contentPath = vdoPath;<br> // Plays the file once loaded<br>
 vdoContainer.play();<br>}</p>
<p>// Loads the Images or Videos inside their loaders on the stage, start with Images<br>loadImages(imgPath);<br>//loadVideos(vdoPath);</p></div>
<div> </div>
<div>Thanks again to anyone who can help,</div>
<div><br>Tim</div>