Event Listener that waits for a MovieClip to stop playing.

Is there a way to execute a funcion once a MovieClip finishes playing. In other words, how could I execute a functionn once a movieClip reaches its last frame.
Who is Participating?
mharfouchConnect With a Mentor Commented:
you just need to add an eventlistener to load the second scene with the onStop command, put the onStop command on your first scene and make the event listener load bomb_mc when it stops. you wont be able to notice it unless you export the swf, i dont think you can preview it?
What kind of function do you mean?

I would do this in the simplest way...Putting an Event Listener on the onStop command and then giving it an attribute...But without knowing exactly what function you want its a bit difficult to help
TonoNamAuthor Commented:
I have a function that just animates a bomb. The animation of the bomb consists of about 400 frames and once the animation reaches the 400th frame I am trying to run another function called explode. I have tried writing the function explode () on the time line of bomb_mc right after stop(); on the frame 400 but for some reason the function explode() does not work when I use it in the time line of bomb_mc and it just works when I put in on the main time line.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.