• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

Tweening Buttons

Since buttons in Flash are a type of symbol, you can tween them just like any other kind of symbol instance. By giving motion to your buttons, you can create moving menus and interfaces that still respond to the pointer and carry out actions assigned to them.

To apply a motion tween to a button:

From the Insert menu, choose New Symbol and create a button symbol.

Return to the main movie Timeline, and drag an instance of it onto the Stage.

Select the instance and open the Actions panel in Normal mode. Add an action to your button instance (Figure 4.8).

Figure 4.8. The action attached to this balloon button instance makes you go to the label happy birthday and begin playing.

Create a motion tween as you would normally for a graphic instance. Insert new keyframes, move or transform each instance, then choose Motion Tween in the Frames panel.

At the end of your motion tween add the action gotoAndPlay(1).

Flash creates an endless loop for your motion-tweened button (Figure 4.9).

Figure 4.9. This balloon floats up and down in a constant loop.

Create a spot on the Timeline where the action assigned to the button Instance takes the user.

Test your movie. Throughout its tween, the button instance is active and responds to your pointer.


Tweened button instances use the actions that are assigned to the first keyframe of the motion tween (Figure 4.10). It's a good idea to assign an action to the button instance first, and then create your motion tween. That way, all subsequent inserted keyframes will contain the same instance with the same actions.

Figure 4.10. Actions assigned to tweened instances. The actions assigned to the first instance of any tween are the ones that are followed.

  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint