Quote:
Originally Posted by atomic
|
Cool find atomic, never seen that one. I am gonna try it.
Here is another one I found that seems really nice, I setup some sample code for demonstration:
http://weblog.motion-graphics.org/ar...c_frame_r.html
ActionScript Code:
// Dynamic FrameRate Prototype
// [url]http://weblog.motion-graphics.org/archives/2006/01/dynamic_frame_r.html[/url]
//
function setFrameRate(frameRate:Number):Void {
var timelineFaster:Function = function () {
me.nextFrame();
updateAfterEvent();
};
var me:MovieClip = this;
clearInterval(me.tweenFaster);
me.tweenFaster = setInterval(timelineFaster, frameRate);
}
MovieClip.prototype.setFrameRate = setFrameRate;
MovieClip.prototype.tweenFaster = new Number();
//
// Three movieclips on stage with instance names of
// ball1_mc, ball2_mc, ball3_mc, I just used the same
// movieclip with a 40 frame motion tween and this on
// the last frame in a code layer -- this.gotoAndPlay(1);
// for testng purposes.
//
ball1_mc.setFrameRate(1); // ball1 Fast
ball2_mc.setFrameRate(200); // ball2 Slow
// ball3_mc is using your standard timeline framerate
//
// 4 movieclips used as buttons for slowing down
// and speeding up.
//
b1slow_mc.onRelease = function (){ // ball1_mc Slow
ball1_mc.setFrameRate(100);
}
b1fast_mc.onRelease = function (){ // ball1_mc Fast
ball1_mc.setFrameRate(1);
}
b2slow_mc.onRelease = function (){ // ball2_mc Slow
ball2_mc.setFrameRate(200);
}
b2fast_mc.onRelease = function (){ // ball2_mc Fast
ball2_mc.setFrameRate(10);
}
/*
You can also use it on a MovieClips timline
to alter the speed during the duration of your
animations etc...
Here is a sample of doing just that, create a 120
frame animation of something and make a code layer
with tthe following 4 scripts and then test the movie.
Frame 1 AS Layer Code
this.setFrameRate(1); // crazy fast
Frame 40 AS Layer Code
this.setFrameRate(40); // slower
Frame 80 AS Layer Code
this.setFrameRate(200); // very slowwwwwwwwwer
Frame 120 AS Layer Code
stop(); // the end - so stop
// or
// this.gotoAndPlay(1); // to loop the animation again
*/