1. Home
  2. Computing & Technology
  3. Animation

Flash Animation 11: ActionScripting to Link Your Buttons And Scenes

By , About.com Guide

6 of 6

Breakdown of the ActionScript Code and Conclusion

There's now a new value in the code--the name of the scene, in quotes and separated from the frame number by a comma. (You'll also see a semicolon ( ; ) at the end of the line of code; this is standard to show an end to the command line and is necessary for Flash to know that this is where the command stops.) Let's break this down into parts:

on (release) {} : tells Flash which action is going to trigger the commands that follow inside the brackets ( {} ) ; in this case, the release of a mouse click on the button.
gotoAndPlay () : tells Flash what action to perform after the trigger of a released click--it's going to go to something and play it.
"Blue Option" : tells Flash where it's going to perform the "play" part of the gotoAndPlay command. It's almost like a map that says "turn left at this street". Don’t' forget that it's separated by a comma from other parameters so that Flash knows to read them as separate things.
1 : tells Flash what frame number to start on when it gets to "Blue Option". If "Blue Option" says "turn left at this street", then "1" is the street address of the place on that street where you're going.

And you've just created a clickable button that actually plays something when you perform an action. You'll need to repeat his for your other options to complete the project. You can see my end result here.

Explore Animation
About.com Special Features

Holiday Central

What to eat, where to go, fun things to do and how to save money on the perfect gifts. More >

Family Tech Center

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

  1. Home
  2. Computing & Technology
  3. Animation
  4. Flash Animation Tutorials
  5. Flash Animation 11: ActionScripting to Link Your Buttons And Scenes

©2009 About.com, a part of The New York Times Company.

All rights reserved.