User Guide

1316 Tween class
5. Add the following ActionScript to Frame 1 of the actions layer:
import mx.core.View;
import mx.transitions.easing.*;
my_acc.createChild(View, "studio_view", {label:"Studio"});
my_acc.createChild(View, "dreamweaver_view", {label:"Dreamweaver"});
my_acc.createChild(View, "flash_view", {label:"Flash"});
my_acc.createChild(View, "coldfusion_view", {label:"ColdFusion"});
my_acc.createChild(View, "contribute_view", {label:"Contribute"});
my_acc.setStyle("openEasing", Bounce.easeOut);
my_acc.setStyle("openDuration", 3500);
This code imports the easing classes, so you can type Bounce.easeOut instead of referring
to each of the classes with fully qualified names such as
mx.transitions.easing.Bounce.easeOut. Next, the code adds five new child panes to
the Accordion component (Studio, Dreamweaver, Flash, ColdFusion, and Contribute).
The final two lines of code set the easing style from the default easing method to
Bounce.easeOut and set the length of the animation to 3500 milliseconds (3.5 seconds).
6. Save the document, and then select Control > Test Movie to preview the file in the test
environment.
Click each of the different header (title) bars to view the modified animations and switch
between each pane.
If you want to increase the animation speed, decrease
openDuration from 3500
milliseconds to a smaller number. The default duration for the animation is 250
milliseconds (one fourth of a second).
Applying easing methods to the ComboBox
component
The process to change the default easing method on a ComboBox component is similar to the
example in Applying easing methods to an Accordion component” on page 1315 where you
modify the Accordion components animation. In the following example, you use
ActionScript to dynamically add the component to the Stage at runtime.
To apply easing methods to a ComboBox component:
1. Create a new Flash document and save it as combobox.fla.
2. Drag a copy of the ComboBox component from the Components panel to the current
document’s library.
NOTE
The component appears in the library (not on the Stage) and is available to the SWF
file at runtime.