-
[F8] Control playhead
I'm not really sure how to control the playhead more than the simple stop(); deal...
If I want the playhead to return to any area on the main timeline, what kind of action script to I write?
For instance, I would like to
(this sounds right in my head)
"at end of movie, gotoAndStop on the root timeline, frame (1) "
How do I write that in AS2, and should that code be placed on the Actions, on the main timeline?
-
You can do it a couple of ways. From what you wrote I'm getting that you have a movieClip with some animation and you want to get the main timeline to play when the movieClip gets to the end of the animation. you could put the code on a layer in the movieclip and use _root to get to the main timeline like
_root.gotoAndPlay(2);
you'd put this on the last frame of the movie clip. Or you could do something on the main timeline like
this.onEnterFrame= function(){//runs function 1 time every frame
if(myMC._currentframe == 30){//every frame we check if you mc is at frame 30
gotoAndPlay(2);//if your mc is at frame 30 then play
delete this.onEnterFrame;//remove the onEnterFrame because we don't need it anymore.
}
}
There are other ways but those are the two I'd recommend.
-
Project completed
Thank you very much for the quick response. I used the first of your two suggestions, and it worked fine. I had been doing similar the entire time and found some other mistakes along the way. Again, thanks!