1. Home
  2. Computing & Technology
  3. Animation

Flash Animation 11: ActionScripting to Link Your Buttons And Scenes

By Adrien-Luc Sanders, About.com

5 of 6

Setting Your gotoAndPlay Properties

All that's left to do is set the correct scene. On the Scene dropdown, click to expand; you can use simple options like <current scene>, <next scene>, and <previous scene>, but those are rather non-specific and can create issues if you start moving scenes around in a complex movie. Instead we're going to select a scene name; I named my two extra scenes with my options, to make them easier to find. For this one, since I'm using the blue button, I'm using the scene labeled Blue Option.

When you click on the scene, it will update your code to reflect it; you can leave the "Type" alone, as we want it to go to a particular frame in our scene--that is we, want it to start from the beginning, so we want to leave the type as Frame Number and the Frame as 1 so that it goes to frame 1 in the scene Blue Option and begins to play. (If this is a little confusing, look at it this way: the Type option tells Flash what kind of information is going inside the parentheses to provide parameters for the gotoAndPlay command, while the value that follows--in this case a number for Frame--is the actual value for the parameter itself.)

Explore Animation
About.com Special Features

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

Easy ways to connect two computers for networking purposes. 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.