FMX-duplicating MC in sequence

I want to ask if someone can follow me in the right direction of this matter, I want to have a function to duplicating mc or better to place mc on the stage in sequence, imagine, one after anotherm not all when the movie starts, this is possible whit actionscript? I thought to try to use the set Interval, but I don´t know if it is the right way to do it.

thanks

jagunco BOY

A life less ordinary*

[AS]//make original clip on stage invisible
targetClip._visible = false;
//set how many duplicated clips
var maxClips = 10;
//variable to be used in adding clips
var i = 0;
//function to add clip
function addClip() {
//increment the i variably by 1
i++;
//duplicate target clip
newClip = targetClip.duplicateMovieClip(“newClip”+i, i);
//move new clip along _x axis
newClip._x = i*(newClip._width+10);
//if the variable i is greater than or equal to the maxClips variable
if (i>=maxClips) {
//clear the interval and stop running this function
clearInterval(addClipsInterval);
}
}
//use setInterval to call the addClip function every 100 milliseconds
var addClipsInterval = setInterval(addClip, 100);
[/AS]

Theres an example, create a clip on the stage with the instance targetClip to see how it works.

Just for an example of how you might use this, here is the .fla for my footer. If you don’t understand anything, just ask. :wink:

lostinbeta

this is precisely what i needed, , I must workmore on this, because i want to use it whit some Image Box, i think is cooler to have images appearing one witch time. I had alays problems whit duplicating movie clips to amke “grids” (I think the term is this), but I´m working on it. You know I´m a fun of less than 10 frames ussed in the main timeline.

:slight_smile:

**njs12345 **

that was not what I was talking about, but thanks anyway for helping

Never mind. I was just trying to help you get the concept.

Anyway, glad you fixed your problem.

:slight_smile:

i talked earliar that i thought

i was trying to use it whit MPIIMAGE BOX, and image box that i found in Macromedia exchange, but the thing dosen´t work. When i duplicate the image box, it´s okay, but whe i try to target every instance of it, the thing dosen´t work.

Do you think youcan lok at both codes, I was trying some experiments