Flash Basics: AS3 Buttons

You need to upgrade your Flash player (v.9 or later) to view this tutorial.

Topics covered: How to script buttons using ActionScript 3.0. The tutorial above includes the function, MouseEvent, addEventListener, instance names (for buttons) and frame labels (in the Timeline).

This tutorial does not explain how to create a Button Symbol.

You need to upgrade your Flash player (v.10 or later) to view this tutorial.

The example above can be downloaded as an exercise for you to complete or as a solution. Each FLA file is 60 KB (Flash CS4 or later required). In the exercise, you will find one finished button and instructions on completing the other two. In the solution, you will find three fully functioning buttons, each of which sends you to a different location on the Timeline. The version below has exactly the same structure, but it begins to approximate a storytelling device.

You need to upgrade your Flash player (v.10 or later) to view this tutorial.

Exercises for AS3 Buttons

Below are the finished results of two more exercises designed to help you learn how to script navigation buttons using ActionScript 3.0. To work on the exercise, download the FLA file. You must have Flash CS3 or later to use these exercises.

Please note: You must understand the difference between a frame and a keyframe in Flash if you hope to make use of these two exercises! You will create new keyframes to hold frame labels, or ActionScript, or both.

You need to upgrade your Flash player (v.9 or later) to view this completed exercise.

The exercise above teaches you to create frame labels, give instance names to buttons, and troubleshoot your ActionScript functions. [ download 532 KB ]

Use the tutorial at the top of this page to teach yourself how to make the buttons work properly.

You need to upgrade your Flash player (v.9 or later) to view this completed exercise.

The exercise above teaches you to write ActionScript functions, create frame labels, give instance names to buttons, and troubleshoot your Timeline. [ download 116 KB ]

Use the tutorial at the top of this page to teach yourself how to make the buttons work properly.

 

My blog is Teaching Online Journalism. Please use the feedback form here to comment on the tutorials.

For more tutorials, see the index.

Creative Commons License

This work is licensed under a Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 License. To attribute this work, include my name, Mindy McAdams, and a link to this page.