MACROMEDIA FLASH MX 2004-USING COMPONENTS Use Manual page 132

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

Advertisement

Button parameters
You can set the following authoring parameters for each Button component instance in the
Property inspector or in the Component inspector:
label
sets the value of the text on the button; the default value is Button.
icon
adds a custom icon to the button. The value is the linkage identifier of a movie clip or
graphic symbol in the library; there is no default value.
toggle
turns the button into a toggle switch. If
clicked and returns to the up state when clicked again. If
push button; the default value is
selected
if the toggle parameter is
(
) or released (
true
labelPlacement
one of four values:
information, see
You can write ActionScript to control these and additional options for the Button component
using its properties, methods, and events. For more information, see
Creating an application with the Button component
The following procedure explains how to add a Button component to an application while
authoring. In this example, the button is a Help button with a custom icon that opens a Help
system when a user clicks it.
To create an application with the Button component:
Drag a Button component from the Components panel to the Stage.
1.
In the Property inspector, enter the instance name helpBtn.
2.
In the Property inspector, do the following:
3.
Enter Help for the label parameter.
Enter HelpIcon for the icon parameter.
To use an icon, there must be a movie clip or graphic symbol in the library with a linkage
identifier to use as the icon parameter. In this example, the linkage identifier is HelpIcon.
Set the
toggle
Select Frame 1 in the Timeline, open the Actions panel, and enter the following code:
4.
function click(evt){
clippyHelper.enabled = evt.target.selected;
}
helpBtn.addEventListener("click", this);
The last line of code adds a
and disables the
132
Chapter 6: Components Dictionary
false
true
). The default value is
false
orients the label text on the button in relation to the icon. This parameter can be
,
,
, or
left
right
top
Button.labelPlacement
property to
.
true
event handler to the
click
instance, which could be a Help panel of some sort.
clippyHelper
, the button remains in the down state when
true
false
.
, this parameter specifies whether the button is pressed
.
false
; the default value is
bottom
.
helpBtn
, the button behaves like a normal
. For more
right
"Button class" on page
instance. The handler enables
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?

Questions and answers

Subscribe to Our Youtube Channel

This manual is also suitable for:

Flash mx

Table of Contents