7 days of WordPress plugins, themes & templates - for free!* Unlimited asset downloads! Start 7-Day Free Trial
  1. Code
  2. ActionScript

Quick Tip: Change the Frame Rate at Runtime Using ActionScript 3

Scroll to top
Read Time: 1 min

Dive into this Quick Tip and discover how to change the Frame Rate of your movie, while it's running…

Final Result Preview

Let's take a look at the final result we will be working towards:

Step 1: Brief Overview

We'll make use of a Slider component to modify the stage framerate property and display a MovieClip to see the changes.

Step 2: Set Up Your Flash File

Launch Flash and create a new Flash Document, set the stage size to 400x200px and the frame rate to 25fps.

Step 3: Interface

This is the interface we'll be using, it includes a Slider Component and a MovieClip taken from my Apple Preloader tutorial.

You'll also notice some static text below the slider indicating the minimum and maximum FPS.

Step 4: Slider

Open the Components Panel (Cmd+F7) and drag the Slider component from the User Interface folder, align it to the center in the stage and click the Properties Panel to edit its parameters.

Use the data from the image above and prepare for some ActionScript 3…

Step 5: ActionScript

Create a new ActionScript Class (Cmd+N), save the file as Main.as and start writing:

Step 6: Document Class

Remember to add the class name to the Class field in the Publish section of the Properties panel.


Try the demo and experiment with the uses of this feature!

I hope you liked this Quick Tip, thank you for reading!

Did you find this post useful?
Want a weekly email summary?
Subscribe below and we’ll send you a weekly email summary of all new Code tutorials. Never miss out on learning about the next big thing.
Looking for something to help kick start your next project?
Envato Market has a range of items for sale to help get you started.