PDA

View Full Version : Pushing movieclips created by create/duplicateMovieClip into 1 movieclip?



REEFˇ
August 29th, 2006, 05:42 PM
Okay using createMovieClip I've created an MC called container0. Now, using duplicate movieclip & some for loops, the movie created up to 20 containers which go by the name of:

container1
container2
..
container20

Now is there any way (possibly using a for loop) to push all containers from 0 to 20 into 1 master movieclip?

OR

Is it even possible during the duplicateMovieClip/createMovieClip function that I can arrange which movieclip the new duplicated/created movieclip goes into?

--

So you know the story, I'm trying to create a ton of boxes, that I eventually want to use the image pan script on.

SmoothDime
August 29th, 2006, 06:12 PM
var world_mc:MovieClip = _root.createEmptyMovieClip("world_mc", 0);

for(var i:Number = 0; i < 20; i++)
{
var country_mc:MovieClip = world_mc.createEmptyMovieClip("C" + i, i);

for(var j:Number = 0; j < 50; j++)
{
var state_mc:MovieClip = country_mc.createEmptyMovieClip("S" + j, j);
}
}

REEFˇ
August 29th, 2006, 06:24 PM
Lifesaver! Thanks very much works like a charm.

SmoothDime
August 29th, 2006, 07:41 PM
I'm actually a snake charmer!