PDA

View Full Version : duplicateMovie


Helpme
11-19-2002, 11:27 AM
Can anyone help me with an example??
I 'm trying to make a movie where I get x number of names from a asp file, then entering them into a movie clip. What I'm struggeling with is that I don't want the next movie clipt to start before the one before it is finished. I only get all movie clips to start at the same time. Here's my code:

for(i=0;i<this.count;i++) {
duplicateMovieClip(this.container.catNameBox,"catNameBox"+i,100+i);
tmpObj = eval("this.container.catNameBox"+i);
tmpObj.catName = eval("this.artistname"+i);
tmpObj.catId = eval("this.id"+i);
tmpObj._x = 0;
tmpObj._y = 0;
}

I got a hint that I need to this with a multi-frame loop or with an onClipEvent(enterFrame) instead of a loop, but I just can't figure it out...nice if some one has an example for me!!!

Ricod
11-19-2002, 03:44 PM
What do you mean ? You don't want the next created before the previous finished playing or you don't want it to play until the previous one is finished ? The first is indeed best to be done in a onClipEvent where you check the currently playing clip for its status and the last can be done with your loop and add some code to check which one should be playing next.

Helpme
11-21-2002, 08:57 AM
I mean I don't want it to play until the previous one is finished...

Ricod
11-23-2002, 07:38 AM
Let's see ... I'd put a stop on the first frame of the mc you're going to duplicate. Then, on the end, you can let it say that its finished (just a "finished=1;" will do. But if you send it to the _root, I'd use some kind of identifier, or else you keep overwriting and / or its already has a value of 1 (for example _root.clip1_finshed = 1;) I'd go with the first ...)

After you're done duplicating you can send to the main timeline to play the first. _root.playMc =0;

Some kind of controller clip will be handy (just an empty mc, or another mc that's present during the animation, but I'd advise not to use the mc you're duplicating) And you can have something like :
onClipEvent(enterFrame) {
if (_root.container.["catNameBox"+_root.playMc].finished == 1;) {
_root.playMc++;
_root.container["catNameBox"+_root.playMc].gotoAndPlay(2);
}