Answers Search Help
Boston University home page
 
    Basics
 
 
 
 
 
 
 
    Interface
 
 
 
 
 
    Concepts
 
 
 
    Animation
 
 
 
 
 
    Buttons
 
 
 
    Publishing
 
 
    Also See
   
   

Controlling the Movie

As you have probably noticed when testing your animations, the default behavior in Flash is to loop infinitely. However, in most real movies you need specific behaviors- such as starting, stopping, playing certain frames, and so forth- to occur at precise times.

The means of controlling your animation is based on commands known as actions. You can use simple, pre-built actions that are provided with Flash, or you can write your own using Flash's programming language, Action Script. These can be extremely complex, such as loading data or additional movies, branching to a different part of a movie based on user input, and so forth. While we will not discuss Action Script programming, we will see how some basic actions work.

The most common commands are listed in the Actions panel:

Actions can be attached to any keyframe of your movie. When a frame has an action attached to it, a small a is displayed in the frame.

In the example above, the action attached to the frame is Stop. This causes the movie to play once and stop, rather than loop.

It's good practice in Flash to separate frame actions from frame content. This is done by creating a layer specifically to hold actions. At any point in the movie that you want a frame action to occur, you can insert a blank keyframe in the actions layer, and associate the action with that keyframe.

To add a Stop action to the last keyframe of your movie, do the following steps:

  1. Create a new layer and name it Actions.
  2. Highlight the the frame where you want the movie to stop and select Insert | Blank Keyframe from the menu.

  3. With the blank keyframe still highlighted, go to the Actions panel and double-click Stop.

  4. Select Control | Test Movie to see the difference in behavior. Note: To see the movie below, you will need to click the Refresh button in your browser.

WebCentral Using Publishing Learning Training Consulting WebCentral
Answers Search Help
NIS  |  OIT  |  Boston University  |   February 7, 2007