<div>That helped thanks, The targeting has been solved however I'm still having trouble setting the contentPath initially from within my function.</div>
<div> </div>
<div>I have a movieClip in my library called loaderIMG<br>inside loaderIMG i have an instance of the loader component from my library, given the instance name imgContainer. This instance has been given a default contentPath of "pics/default.jpg" then in my _root timeline i have this function:
</div>
<div><br>function loadImages (imgPath)<br>{<br>createLoaderIMG(); //function to add loaderIMG to the stage<br>loaderIMG.imgContainer.contentPath = imgPath;<br>}<br>loadImages("pics/photo1.jpg"); // Should change the contentPath to that
</div>
<div>
<p>so its adding the movieclip to the stage with the default contentPath as it should,</p>
<p>but then its not changing it to the specified.<br><br>if i create a button and set:</p>
<p>on (release) { loaderIMG.imgContainer.contentPath = "pics/photo1.jpg"; }<br><br>then it changes the contentPath but i want to be able to change it initially when the function is called.</p>
<p>Any more help please?</p>
<p>Thanks alot,</p>
<p>Tim<br></p></div>
<div> </div>
<div> </div>
<div>Message: 3<br>Date: Sun, 3 Sep 2006 19:38:25 +1000<br>From: "Aran Rhee" <<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:aran.rhee@qdc.net.au">aran.rhee@qdc.net.au</a>><br>Subject: Re: [SWFObject] ExternalInterface and Levels
<br>To: <<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:swfobject@lists.deconcept.com">swfobject@lists.deconcept.com</a>><br>Message-ID: <000d01c6cf3c$bb78a070$0300a8c0@HYPERION><br>Content-Type: text/plain; charset="us-ascii"
<br><br>Tim.<br><span></span><br>I think you are just having a targeting issue since you components are<br>inside a movieClip you are attaching.<br><br>If you moviclip you are attaching is called "LoaderIMG", then you need to
<br>set the path on the component INSIDE you MC. If your movieClip loader<br>component instance is called "loader", then you would set its contenpath<br>like:<br><br>LoaderIMG.loader.contentPath ="some.jpg"
<br><br><br>again, with the FLV player: if "LoaderFLV" is your MC you are attaching, and<br>your flv playback component instance is called "playback", set its content<br>path like:<br><br>LoaderFLV.playback.contentPath
 = "some.flv"<br><br><br>Cheers,<br>Aran<br><br><br> _____<br><br>From: <a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:swfobject-bounces@lists.deconcept.com">swfobject-bounces@lists.deconcept.com
</a><br>[mailto:<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:swfobject-bounces@lists.deconcept.com">swfobject-bounces@lists.deconcept.com</a>] On Behalf Of ReDrUm<br>Sent: Sunday, 3 September 2006 5:19 PM
<br>To: <a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:swfobject@lists.deconcept.com">swfobject@lists.deconcept.com</a><br>Subject: [SWFObject] ExternalInterface and Levels<br><br><br>Hi Everyone,<br>
<br>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.<br><br>The First:<br>To have an image loader using the Loader Component in the hopes of changing
<br>the contentPath via ExternalInterface<br><br>The Second:<br>To have a flash video player using the FLVPlayBack Component. Again changing<br>the contentPath via ExternalInterface<br><br>My Problem:<br>I've added the two components to my library, and created two movie clips,
<br>LoaderIMG, and LoaderFLV. Inside each of these MCs is the appropriate<br><span></span>component with a set instance name. I only want one component on the screen<br>at once. What i want to achieve is the ability to change the content path of
<br>each component externally using the ExternalInterface in Flash 8. Ignoring<br>the fact that my end goal is to use external interface, in the meantime I am<br>currently having trouble figuring out how to change the contentPath of the
<br>two loaders. They each only load their origional contentPath values set in<br>the component instances in the Loader MC's I created. I've been<br>experimenting with _root, _parent, and _levels but I'm still not having much
<br>luck. If any of you could suggest a fix or an alternative method I would<br>much appreciate it.<br><br>Thanks alot.<br><br>Actionscript below:<br><br>// This is a gateway to JavaScript via the ExternalInterface (Do i need two
<br>- one for each function to be called externally?)<br>var ei1 = flash.external.ExternalInterface.addCallback("loadImages", null,<br>loadImages);<br>var ei2 = flash.external.ExternalInterface.addCallback("loadVideos", null,
<br>loadVideos);<br><br>// Temp for development (Its not loading these paths currently which is what<br>i want to fix)<br>imgPath = "pics/red.gif";<br>vdoPath = "media/test2.flv";<br>trace(imgPath);<br>
trace(vdoPath);<br><br>// 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>}<br><br>// 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><span></span> loaderIMG._y = 0;<br>}<br><br>// Function to set the contentPath of the images and call createLoaderIMG
<br>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>}<br><br>// Function to set the contentPath of the videos and call createLoaderFLV<br>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>}<br><br>// Loads the Images or Videos inside their loaders on the stage, start with
<br>Images<br>loadImages(imgPath);<br>//loadVideos(vdoPath);<br><br><br>Thanks again to anyone who can help,<br><br>Tim<br> </div>