Change the hit area of a button
71
Name a button instance
As a best practice, name instances of symbols on the Stage. ActionScript relies on the instance
name to identify the object.
•
With the button that you created still selected, open the Property inspector (Window >
Properties). In the Instance Name text box, type
logo_btn
.
View the hit area by enabling buttons
When the Enable Simple Buttons feature is active, you can view the less complex aspects of your
buttons, such as the hit area (the clickable area of a button) and the colors used for the button
states. More complex button design, such as animation, does not play.
1.
Click in an empty space in the work area, to make sure you don’t have any objects selected.
2.
Select Control > Enable Simple Buttons, and then move the mouse pointer over different areas
of the button that you created.
The only areas of the button that are clickable (as indicated when the pointer changes to
a hand) are the text area and the logo. The white space around the text and logo are
not clickable.
3.
Select Control > Enable Simple Buttons again to deselect the feature so that you can edit
the button.
Next, you’ll redefine the hit area so that the button area covers the entire grouped area.
Change the hit area of a button
You can specify a hit area that’s a different size from the default hit area by adding a keyframe to
the Hit frame of the button symbol, and then drawing a shape that defines the hit area.
1.
On the Stage, double-click the logo button that you created to view the button Timeline. The
button Timeline contains the following states:
■
Up
■
Over
■
Down
■
Hit
2.
Double-click the Layer 1 name in the Timeline and rename the layer
Hit Area
.
Summary of Contents for FLASH MX 2004-LEARNING FLASH
Page 1: ...Learning Flash...
Page 8: ...8 Contents...
Page 34: ...34 Chapter 3 Write Scripts with ActionScript...
Page 54: ...54 Chapter 6 Create a User Interface with Layout Tools...
Page 62: ...62 Chapter 7 Draw in Flash...
Page 68: ...68 Chapter 8 Create Symbols and Instances...
Page 76: ...76 Chapter 9 Add Animation and Navigation to Buttons...
Page 104: ...104 Chapter 13 Add Interactivity with ActionScript...
Page 112: ...112 Chapter 14 Create a Form with Conditional Logic and Send Data...
Page 122: ...122 Chapter 15 Work with Objects and Classes Using ActionScript 2 0...