I have a series of movie clips and want to play then one after another. If i put each one in a single keyframe after each other on the timeline, what actionscrip do i need to use (i used to be able to do it in actionscript 2!)
thanks very much,
Chances are whatever you did in AS2 would work with some minor changes. If you understand that approach then you should explain it and the changes you need to make can be identified.
Otherwise, here's some options.... First, you need to place a stop(); command in each frame where you place one of the movieclips so that the main timeline will stop for each movieclip to play.
Then you need to have something that detects when the current movieclip has finished. If these movieclips are all timeline animations, then you could place a command in the last frame to tell the maintimeline to go to the next frame.... MovieClip(parent).nextFrame(); An alternative would be to constantly monitor the currentFrame property versus the totalFrames property of the current movieclip from the main timeline and have it issue the same command when they are equal.
If the movieclips are code-based animations, then you need to have the movieclips manage indicating when they are done, either by using the same command as mentioned before, or by dispatching an event that indicates they are done for which you have an event listener assigned in the main timeline.
Great - thanks for your response. Yes - in AS 2 i was doing a similar thing to your suggested, but i also actually have an added element as in I'm using FlashEff2 components for the animation within each movie clip, which in effect, can all happen within one keyframe in the movie clip. My workaround would be to estimate how long each animation lasts, and put the MovieClip(parent).nextFrame() at the end of each movie clip after the correct number of seconds - which seems to work ok. If there is a way of doing it once the animation has finshed, then would be great to know that too, but thanks again for your help!
I am not familiar with whatever FlashEff2 components are. Is this some external class/component that you acquired somewhere or is it some feature within Flash that I have yet to discover?
If they are animation-related components then they should generate events relative to whatever they do... one of which I would hope to be an indication of the animation being complete. So you should go thru the documenation for the component to see if it does generate an event that might provide the indication you are looking for and then you should be able to add an event listener for that event in the main timeline and use it's evvent handler function to advance to the next frame.
Here's a link to a page that I think involves the earlier version of the component and which is likely still relative to the version 2 as far as events go.