MACROMEDIA FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH Manual page 608

Learning actionscript 2.0 in flash
Table of Contents

Advertisement

13.
Select Insert > Timeline > Layer to create a new layer, and name it button.
14.
Select the Rectangle tool in the Tools panel.
15.
In the Colors section of the Tools panel, click the pencil icon to select the Stroke
color control.
16.
Select No Color, which disables the rectangle's outline.
17.
Drag the pointer diagonally across the Stage to create a rectangle.
The size of the rectangle does not matter because you'll resize it by using the
Property inspector.
18.
Click the Selection tool in the Tools panel then click the rectangle on the Stage to select it.
19.
With the rectangle still selected, type 468 in the width text box and 60 in the height text
box in the Property inspector. Then change the X and Y coordinates (X and Y text boxes)
to 0.
20.
With the rectangle selected on the Stage, press F8 to change the rectangle into a symbol.
21.
In the Convert to Symbol dialog box, type invisible btn in the Name text box, select
Button, and then click OK.
22.
Double-click the new button on the Stage to enter symbol-editing mode.
The rectangle is currently on the first Up frame of the button you created. This is the Up
state of the button—what users see when the button is on the Stage. However, you want
the button to not be visible on the Stage, so you need to move the rectangle to the Hit
frame, which is the hit area of the button (the active region that a user can click to activate
the button's actions).
23.
Click the keyframe at the Up frame, and hold down the mouse button while you drag the
keyframe to the Hit frame.
You can now click in the entire banner area, but there is no visual appearance of the
button on your banner.
24.
Click Scene 1 to return to the main Timeline.
A teal rectangle appears over the banner area, representing the invisible button's hit area.
25.
Select the button you created, open the Property inspector, and type inv_btn in the
Instance Name text box.
26.
Select Frame 1 on the Timeline, and then type the following code in the Actions panel:
inv_btn.onRelease = function(){
getURL("http://www.macromedia.com");
};
27.
Make other modifications to the banner, such as adding graphics or text.
28.
Select Control > Test Movie to test the banner in Flash Player.
608
Working with Images, Sound, and Video

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Flash 8

Table of Contents