Skip to main content
August 10, 2011
Answered

increase frame rate within flash animation

  • August 10, 2011
  • 1 reply
  • 5283 views

Any way that I can adjust the frame rate of a movieclip without affecting the frame rate that I set for the rest of the document.

I want to speed up the animation of this clip and it would be difficult to adjust the timeline of this clip to accomplish this.

thanks

This topic has been closed for replies.
Correct answer Kenneth Kawamoto

Ken,

I used your enterFrame event idea (along with frame labels on every other frame) and it works fine. Only issue is that I want the animation to keep looping but it does not - It goes back to frame 1 and stops there - any other suggestions.

Here is my sample coding for the timeline in AS3

addEventListener(Event.ENTER_FRAME,enterFrameFunction);

function enterFrameFunction(event:Event) {

gotoAndPlay("b");

}

addEventListener(Event.ENTER_FRAME,enterFrameFunction2);

function enterFrameFunction2(event:Event) {

gotoAndPlay("c");

}


An example. I have a MovieClip called movieclip on stage. This movieclip has stop() in the frame 1. Below will play movieclip in the double speed of the stage frameRate, and it loops.

import flash.events.Event;

addEventListener(Event.ENTER_FRAME, enterFrame);

function enterFrame(e:Event):void {
    var targetFrame:uint = movieclip.currentFrame + 2;
    if(targetFrame > movieclip.totalFrames) targetFrame = 0;
    movieclip.gotoAndStop(targetFrame);
}

1 reply

Ned Murphy
Legend
August 10, 2011

The frame rate is a one and only, so changing it in one place changes it every place.

August 10, 2011

I did some google searches and some folks offered some coding that did not work and others said the same thing as you.

Looks like I'll have to adjust my timeline

Thanks

relaxatraja
Inspiring
August 11, 2011

Ned is correct, your frame rate will affect the whole. but you can control that by assigning and reverting wherever you want by

stage.frameRate=30;

and at the specific frame you can revert it back as

stage.frameRate=24;

Try with this, but whever you apply if affect the whole.