MACROMEDIA FLASH 8-COMPONENTS LANGUAGE Reference page 1321

Components language reference
Table of Contents

Advertisement

3.
Insert a new layer and rename it actions.
Make sure the actions layer is above Layer 1.
4.
Add the following ActionScript to Frame 1 of the actions layer:
import mx.transitions.easing.*;
this.createClassObject(mx.controls.ComboBox, "my_cb", 20);
var product_array:Array = new Array("Studio", "Dreamweaver", "Flash",
"ColdFusion", "Contribute", "Breeze", "Director", "Flex");
my_cb.dataProvider = product_array;
my_cb.move(10, 10);
my_cb.setSize(140, 22);
my_cb.setStyle("openDuration", 2000);
my_cb.setStyle("openEasing", Elastic.easeOut);
After you import each of the easing methods, which occurs in the first line of code, the
createClassObject()
keyword
in the second line of code refers to the main of the SWF file. This line of
this
code puts the component on the Stage at runtime and gives it the instance name
Next, you create an array named
software. You use this array in the following line of code to set the
to the array of product names. Then you use the
component instance, set
easing method to
As with earlier examples, you import the easing classes, which let you use the
shortened version of the class name instead of using the fully qualified class name of
mx.transitions.easing.Elastic.easeOut.
5.
Save the current document, and select Control > Test Movie to view the document in the
test environment.
6.
Click the ComboBox component on the Stage to use the specified easing class to animate
your drop-down list of product names.
Use an easing method such as Elastic or Bounce for your ComboBox or Accordion
components with care. Some users might find it distracting if your options take a
long time to stop moving before they can read and select from the menu. Test your
individual applications and settings, and decide whether the easing methods
enhance or detract from your Flash document.
Animating the DataGrid component
Flash 8 also lets you tweak the animations you use when you select items in a component
(such as the DataGrid, Tree, ComboBox, or List components). Although the animations are
subtle, in some cases you want to control small details or increase the speed of the animation.
method creates an instance of the ComboBox component. The
product_array
openDuration
.
Elastic.easeOut
that contains a list of Macromedia
method to resize the
setSize()
to 2000 milliseconds (2 seconds), and change the
Applying easing methods to components
my_cb
property
dataProvider
.
1317

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Flash 8

Table of Contents