MACROMEDIA FLASH MX 2004-USING COMPONENTS Use Manual page 589

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

Advertisement

NumericStepper parameters
You can set the following authoring parameters for each NumericStepper instance in the Property
inspector or in the Component inspector:
value
sets the value displayed in the text area of the stepper. The default value is 0.
minimum
sets the minimum value that can be displayed in the stepper. The default value is 0.
maximum
sets the maximum value that can be displayed in the stepper. The default value is 10.
stepSize
sets the unit by which the stepper increases or decreases with each click. The default
value is 1.
You can write ActionScript to control these and additional options for the NumericStepper
component using its properties, methods, and events. For more information, see
"NumericStepper class" on page
Creating an application with the NumericStepper component
The following procedure explains how to add a NumericStepper component to an application
while authoring. In this example, the stepper allows a user to pick a movie rating from 0 to 5 stars
with half-star increments.
To create an application with the NumericStepper component:
Drag a NumericStepper component from the Components panel to the Stage.
1.
In the Property inspector, enter the instance name starStepper.
2.
In the Property inspector, do the following:
3.
Enter 0 for the minimum parameter.
Enter 5 for the maximum parameter.
Enter .5 for the stepSize parameter.
Enter 0 for the value parameter.
Select Frame 1 in the Timeline, open the Actions panel, and enter the following code:
4.
movieRate = new Object();
movieRate.change = function (eventObject){
starChart.value = eventObject.target.value;
}
starStepper.addEventListener("change", movieRate);
The last line of code adds a
sets the
starChart
instance. (To see this code work, you must create a
property that displays the stars.)
592.
event handler to the
change
movie clip to display the amount of stars indicated by the
instance. The handler
starStepper
movie clip with a
starChart
NumericStepper component
starStepper
value
589

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

This manual is also suitable for:

Flash mx

Table of Contents