MACROMEDIA FLASH 8-COMPONENTS LANGUAGE Reference page 1320

Components language reference
Table of Contents

Advertisement

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
to each of the classes with fully qualified names such as
mx.transitions.easing.Bounce.easeOut
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
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
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
modify the Accordion component's 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.
The component appears in the library (not on the Stage) and is available to the SWF
file at runtime.
1316
Tween class
and set the length of the animation to 3500 milliseconds (3.5 seconds).
Bounce.easeOut
. Next, the code adds five new child panes to
openDuration
instead of referring
from 3500
where you

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Flash 8

Table of Contents