hello there,
does anyone know how to scrub a movie clips timeline with actionscript?
what i have is a movie that plays continuously and i need it to scrub to a specific frame when someone hits a button.
any help is much appriciated, thanks!
Printable View
hello there,
does anyone know how to scrub a movie clips timeline with actionscript?
what i have is a movie that plays continuously and i need it to scrub to a specific frame when someone hits a button.
any help is much appriciated, thanks!
suppose mcScrub is your button instance name then u can use:
Code:mcScrub.onRelease = function() {
scrubber(_root, 100, "forward");// scrub(movieclip, uptilFrame, scrubdirection)
};
function scrubber(movie:MovieClip, frameno:Number, scrub:String):Void {
movie.stop();
movie.onEnterFrame = function() {
if (scrub == "reverse") {
movie.prevFrame();
} else if (scrub == "forward") {
movie.nextFrame();
}
if (movie._currentframe == frameno) {
delete movie.onEnterFrame;
}
};
}
thanks for the help, i tried your code and must not be smart enough to get it working. i have attached a sample file of a moving mc and a button. can you please help me get this test working.
thanks alot!!!!!
saved it out as flash player 6 and AS 1... your using flash 5? your settings were for flash player 5..
sorry flashkit is really slow and i cant upload the file..hopefully someone else can help u out..sorry i gotta run now...
no im using flash 8, i just saved it as an older version so whoever needed to open it could if they had an older version.
thanks for the help!