MACROMEDIA FLASH 8-COMPONENTS LANGUAGE Reference page 1322

Components language reference
Table of Contents

Advertisement

To add easing to the DataGrid component:
1.
Create a new Flash document and save it as datagrid.fla.
2.
Drag an instance of the DataGrid component onto the Stage, and give it the name
3.
Insert a new layer and rename it actions.
Make sure you place the actions layer above Layer 1.
4.
Add the following ActionScript to the actions layer:
import mx.transitions.easing.*;
my_dg.setSize(320, 240);
my_dg.addColumn("product");
my_dg.getColumnAt(0).width = 304;
my_dg.rowHeight = 60;
my_dg.addItem({product:"Studio"});
my_dg.addItem({product:"Dreamweaver"});
my_dg.addItem({product:"Flash"});
my_dg.setStyle("selectionEasing", Elastic.easeInOut);
my_dg.setStyle("selectionDuration", 1000);
This ActionScript imports the easing classes and resizes the component instance on the
Stage to 320 pixels (width) by 240 pixels (height). Next, you create a new column named
product and resize the column to 304 pixels (width). The data grid itself is 320 pixels wide,
although the scroll bar is 16 pixels wide, which leaves a difference of 304 pixels. Then you
set the row height to 60 pixels, which makes the easing animations easier to see.
The next three lines of ActionScript add items to the data grid instance so you can click
and see the animations. Finally, the
properties are set using the
Elastic.easeInOut
five times longer than the default value of 200 milliseconds).
5.
Save the document and select Control > Test Movie to view the result in the test
environment.
When you click an item in the DataGrid instance, you see the selection ease in and out
using the elastic effect. The animation should be easy to see because the duration is
significantly increased.
You can also use the same properties (selectionEasing and selectionDuration)
with the ComboBox, List, and Tree components.
1318
Tween class
selectionEasing
method. The easing method is set to
setStyle()
and the
is set to 1000 milliseconds (one second, which is
duration
and
selectionDuration
.
my_dg

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Flash 8

Table of Contents