This document provides an introduction to using ActionScript in Adobe Flash to control simple animations and interactions. It demonstrates how to open the Actions panel, use code snippets to add stop and navigation commands to control playback, and add button clicks to change the color of an animated box. The key aspects covered are opening the Actions panel, using code snippets, adding stop and navigation commands, and controlling an animation through button clicks.
2. The Actions panel is a script
wizard, text editor, and
code-checker, all in one.
To open the Actions panel,
choose ‘Window > Actions’,
or press F9 (Windows) or
Option+F9 (Mac OS).
On many laptops, you will
need to add the function (fn)
key: Fn+Option+F9.
3. Code Snippets allow us to get up-and-running
with ActionScript quickly and easily.
Open your project with morphing shapes;
export and playback the movie. You’ll notice
that it continually loops over and over.
Let’s use ActionScript to stop the playback at
the end of the movie.
4. Select the final frame of
the animation.
Open the Code Snippets
and select the ‘Timeline
Navigation’ options and
‘Stop at this Frame’.
This will add a statement
called stop(); at the end
of the movie.
Test the movie. Note
that it now stops at the
end of the movie.
5. Create a brand new project. Add
three button ‘Components’, naming
the three ‘Red’, ‘Green’ and ‘Blue’.
Place a large box in the background
with the colour red.
Create a new keyframe with the box
colour changed to green.
Create a final keyframe with the box
colour changed to blue.
Test the playback; what happens
with the movie?
6.
7. Use ‘Code Snippets’ to make the movie work
correctly.
Remember, you’ll need to stop the movie on
the first frame before you add the other
actions, else you’ll still have issues with
playback.