MACROMEDIA FLASH MX 2004-USING COMPONENTS Use Manual page 139

Using components
Hide thumbs Also See for FLASH MX 2004-USING COMPONENTS:
Table of Contents

Advertisement

Repeat steps 2-11 and create green and blue skins, named accordingly.
12.
Click the Back button to return to the main Timeline.
13.
Drag a Button component to the Stage.
14.
Set the
15.
toggled
Copy the following ActionScript code to the Actions panel with the Button instance selected.
16.
onClipEvent(initialize) {
falseUpSkin = "BlueButtonSkin";
falseDownSkin = "GreenButtonSkin";
falseOverSkin = "BlueButtonSkin";
falseDisabledSkin = "BlueButtonSkin";
trueUpSkin = "RedButtonSkin";
trueDownSkin = "RedButtonSkin";
trueOverSkin = "RedButtonSkin";
trueDisabledSkin = "RedButtonSkin";
}
Select Control > Test Movie.
17.
Button class
Inheritance
MovieClip >
ActionScript Class Name
The properties of the Button class let you do the following at runtime: add an icon to a button,
create a text label, and indicate whether the button acts as a push button or as a toggle switch.
Setting a property of the Button class with ActionScript overrides the parameter of the same name
set in the Property inspector or Component inspector.
The Button component uses the Focus Manager to override the default Flash Player focus
rectangle and draw a custom focus rectangle with rounded corners. For more information, see
"Creating custom focus navigation" on page
Each component class has a
available only on the class itself. The
of the component. To access this property, use the following code:
trace(mx.controls.Button.version);
Note: The code
trace(myButtonInstance.version);
The Button component class is different from the built-in ActionScript Button object.
property value to
true
UIObject class
mx.controls.Button
property, which is a class property. Class properties are
version
version
to see all three skins.
>
UIComponent class
50.
property returns a string that indicates the version
returns
undefined
>
SimpleButton class
> Button
.
Button component
139

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH MX 2004-USING COMPONENTS and is the answer not in the manual?

Subscribe to Our Youtube Channel

This manual is also suitable for:

Flash mx

Table of Contents