How to loop MC once it is nested in the main scene?


I made a MC and put it on the main scene. The MC has its length of about 200 frame. I want it to play 10 times [loop!] on the main scene before jumping to the next scene. It is pretty easy if I add frame to the MC, but imagine its total length. I think the script is the best bet. Please let me know how to write script to make this happen. Should the script be put on the scene or in the MC and I do not know which one suits this requirement best.

Thank you.


in the last frame of your clip (has 2 b a keyframe), put actions s’thing like this (do not copy/paste this, incorrect scripting!): counter
if (counter<10){gotoAndPlay (1);}else{;}//sends the clip back to 1st frame if counter isn’t up to 10, or makes the main timeline play if it is
On 1st frame of clip: counter++; //adds 1 to counter every time this frame is played…there’s other ways, you get the basic idea of using a flag/counter which you increment every time the clip is played, and check before playing it again…?

In other words :

 (counter++<10) ? gotoAndPlay (1) :;

pom 0]

Thank a lot. I will try.

man those MX scripting shortcuts are confusing… what’s the “?” do exactly?

For the record… “So confused” is a great name… you should try to register that with Ezboard… it’s kind of like the Quake III player who has the name “Shoot at me” :slight_smile:

Actually, that’s not an MX shortcut, it was there in F5 too.

Basically, you put it that way :

  (condition) ? (if true) : (if false) ;
for instance :
(Math.random()>0.5) ? trace ("number superior to .5")  : trace ("inferior")  ;


(sorry Pom… had to remove the emoticons to understand that)

thats sexy, I like it…So, wait, if you learn something new everyday, and I just learned something, does that mean I still have to go to my classes? :slight_smile:

I have a big Biology test coming up tomorrow…wish me luck, i need to study my ass off tonight…