URL: http://proto.layer51.com/d.aspx?f=647
Requires Flash MX.
[b][u]autoframeNavigate[/u][/b] : This is to control any child movieClip or to control _root from inside child movieClips to go to a particular frame forward or backwards after a certain delay and then decides wether to play or stop from there.
[u][b]Arguments[/b][/u]
[b]delay :[/b] amount of delay in seconds, the function waits for a period of time then jumps to the desired frame.
[b]bContinue :[/b] this is a string that can be either "stop" or "play" to decied whether you want to tell the movieClip or _root to stop at the desired frame or continue playing.
[b]numberOfFrames:[/b] number of frames to be skipped, this number can be positive to move forward or negative to move backwards.
[u][b]Usage[/b][/u]
//Use the following 2 statements to control the main timeline or any movieClip:- stop(); // wait for 3 seconds, then go to nextframe and continue playing. autoframeNavigate(3000, "play", 1)
//use the following 2 statements To control the main timeline from inside a child movieClip:- stop(); // wait for 3 seconds, tell _root to go backward 2 frames and stop there. _root.autoframeNavigate(3000, "stop", -2)
MovieClip.prototype.autoframeNavigate = function(delay, bContinue, numberOfFrames) { navigate = function(clipName) { desiredFrameNumber = clipName._currentframe + numberOfFrames; bContinue == "stop" ? clipName.gotoAndStop(desiredFrameNumber):clipName.gotoAndPlay(desiredFrameNumber); clearInterval( clipName.autoframeNavigateID ); } this.autoframeNavigateID = setInterval(navigate, delay, this); }
You need to login to post a comment.
