- Web templates
- E-commerce Templates
- CMS & Blog Templates
- Facebook Templates
- Website Builders
How to change the speed in flash
November 15, 2010
Q: How can I speed the frame rate or slow it down when the movie is playing? For example, I would like to slow the frame rate from the default of 20 fps to 15 fps from frame #80 to frame #150. Then frame rate should speed back up to 20 fps after frame #151, (fps = frames per second).
A: One way is to use “interval”. An example of changing the speed of the movie from frame #80 to frame #150 is shown below.
Create a key frame at frame #80 and place this script:
var fps:Number = 80;
var intervalID:Number = setInterval(this, “advanceFrame”, 1000/fps);
stop();
//
function advanceFrame() {
clearInterval(intervalID);
gotoAndStop(_currentframe+1);
if (_currentframe<151) {
intervalID = setInterval(this, “advanceFrame”, 1000/fps);
} else {
play();
}
}