MACROMEDIA FLASH MX 2004-USING COMPONENTS Use Manual page 622

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

Advertisement

RadioButton parameters
You can set the following authoring parameters for each RadioButton 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
data
is the value associated with the radio button. There is no default value.
groupName
is the group name of the radio button. The default value is
selected
sets the initial value of the radio button to selected (
selected radio button displays a dot inside it. Only one radio button in a group can have a selected
value of
. If more than one radio button in a group is set to
true
instantiated last is selected. The default value is
labelPlacement
,
,
left
right
top
RadioButton.labelPlacement
You can write ActionScript to set additional options for RadioButton instances using the
methods, properties, and events of the RadioButton class. For more information, see
"RadioButton class" on page
Creating an application with the RadioButton component
The following procedure explains how to add RadioButton components to an application while
authoring. In this example, the radio buttons are used to present the yes-or-no question "Are you
a Flashist?". The data from the radio group is displayed in a TextArea component with the
instance name
theVerdict
To create an application with the RadioButton component:
Drag two RadioButton components from the Components panel to the Stage.
1.
Select one of the radio buttons. In the Component inspector, do the following:
2.
Enter Yes for the label parameter.
Enter Flashist for the data parameter.
Select the other radio button. In the Component inspector, do the following:
3.
Enter No for the label parameter.
Enter Anti-Flashist for the data parameter.
Select Frame 1 in the Timeline, open the Actions panel, and enter the following code:
4.
flashistListener = new Object();
flashistListener.click = function (evt){
theVerdict.text = evt.target.selection.data
}
radioGroup.addEventListener("click", flashistListener);
The last line of code adds a
handler sets the
property of the selected radio button in the
information, see
622
Chapter 6: Components Dictionary
orients the label text on the button. This parameter can be one of four values:
, or
; the default value is
bottom
.
625.
.
event handler to the
click
property of
text
theVerdict
RadioButton.click
true
.
false
. For more information, see
right
radioGroup
(a TextArea instance) to the value of the
radio button group. For more
radioGroup
.
.
Radio Button
.
radioGroup
) or unselected (
false
, the radio button that is
true
radio button group. The
). A
data

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?

This manual is also suitable for:

Flash mx

Table of Contents