0
votes

I have 15 empty movie clips on the stage which load a swf into each at runtime from an array

i dont know which SWF is in wich movieclip, and the array has 155 SWF's in it, including duplicates.

My question is how to play the swf in empty movieclip 4 or empty movieclip 6

               emptymovieclip1.play(this loaded movie) 

i dont know his name and i dont want to reference him by the key value from the array

1
What's your code for loading the swf ? - Eric
myMovies:Array = new Array("movie1.swf", "movie2.swf")ect gamezslave.com/game/Slots.swf basically this is done with php and flash, so i want to target the movieclip inside the slotmachine payline instead of typing its direct filepath - joshua
Sorry not talking about the clip names, but how you load them into a MC... Or are you loading a clips that loads a clip ?? - Eric
one main movie loads 155 clips into the array, so i f i want to access them i just call the array holderMC.addChild(myMovies[1]) to acess this movie i can call on the timeline myMovies[1].gotoAndPlay(1);// but instaed of writing that out 155 times i want to know how to just play what ever movie i have put into the holderMc at the time - joshua

1 Answers

0
votes

The easy way is to put the reference of the movie in the array as well, like :

var loader:Loader;
var urlReq:URLRequest;
for(var i:uint = 0 ; i < myMovieClips.length; i++){
      //do your loading of your clips here
      loader = new Loader();
      urlReq = new URLRequest(myMovieClips[i]); //like myClipX.swf
      loader.load(urlReq);
      mcHolder.addChild(loader);
      myMovieClips[i] = loader;
 }

Then you can access your clip inside the loader like

 var clip:MovieClip = myMovieClips[5].content as Movieclip