Monday, February 8, 2010

Art 351 - How To Jump Around The Timeline

Create a new blank layer and call it actions. Select the blank keyframe and open up the Actions palette (Window > Actions).

Here's the basic code for jumping around in your timeline.
To add it, click on a blank keyframe in your actions layer and open up the Actions palette.
In the code below, "button1" is the name of my particular button instance. To give your instance a name, select it on the stage and enter an instance name in the Properties palette.

Also note that the "(10)" after the gotoAndPlay command means I want to jump to frame 10.

stop();
button1.addEventListener(
  MouseEvent.MOUSE_UP,
  function(evt:MouseEvent):void {
    gotoAndPlay(10);
  }
);

Here's the same file with a second button added on frame 1

No comments: