Detailed instructions for use are in the User's Guide.
[. . . ] Components Language Reference
Trademarks 1 Step RoboPDF, ActiveEdit, ActiveTest, Authorware, Blue Sky Software, Blue Sky, Breeze, Breezo, Captivate, Central, ColdFusion, Contribute, Database Explorer, Director, Dreamweaver, Fireworks, Flash, FlashCast, FlashHelp, Flash Lite, FlashPaper, Flash Video Encoder, Flex, Flex Builder, Fontographer, FreeHand, Generator, HomeSite, JRun, MacRecorder, Macromedia, MXML, RoboEngine, RoboHelp, RoboInfo, RoboPDF, Roundtrip, Roundtrip HTML, Shockwave, SoundEdit, Studio MX, UltraDev, and WebHelp are either registered trademarks or trademarks of Macromedia, Inc. and may be registered in the United States or in other jurisdictions including internationally. Other product names, logos, designs, titles, words, or phrases mentioned within this publication may be trademarks, service marks, or trade names of Macromedia, Inc. or other entities and may be registered in certain jurisdictions including internationally. [. . . ] Return to the authoring environment, insert a new layer, and name it actions. Add the following ActionScript to Frame 1 of the actions layer.
my_list. change = function(evt:Object) { getURL(evt. target. selectedItem. data, "_blank"); }; my_list. addEventListener("change", my_list);
764
List component
To populate a List instance with a data provider:
1. Select the Free Transform tool and resize the component to fit your application. Select Frame 1 of the Timeline and, in the Actions panel, enter the following:
my_list. dataProvider = myDP;
If you have defined a data provider named myDP, the list fills with data. (For more information about data providers, see List. dataProvider. )
5.
Select Control > Test Movie to see the list with its items.
To use a List component to control a movie clip instance
1. Select the Free Transform tool and resize the component to fit your application. Add the following ActionScript to Frame 1 of the actions layer.
my_list. addItem({label:"play", data:"play"}); my_list. addItem({label:"stop", data:"stop"}); var listHandler:Object = new Object(); listHandler. change = function(evt:Object) { switch (evt. target. selectedItem. data) { case "play" : my_mc. play(); break; case "stop" : my_mc. stop(); break; default : trace("unhandled event: "+evt. target. selectedItem. data); break; } }; my_list. addEventListener("change", listHandler);
8.
Select Control > Test Movie to use the list to stop and play the my_mc movie clip instance.
Using the List component
765
To create a List component instance using ActionScript:
1.
Drag the List component from the Components panel to the library. This adds the component to the library, but doesn't make it visible in the application. Select the first frame in the main Timeline, open the Actions panel, and enter the following code:
this. createClassObject(mx. controls. List, "my_list", 1); my_list. addItem({label:"One", data:dt1}); my_list. addItem({label:"Two", data:dt2});
2.
This script uses the method UIObject. createClassObject() to create the List instance.
3.
Select Control > Test Movie.
Customizing the List component
You can transform a List component horizontally and vertically while authoring and at runtime. While authoring, select the component on the Stage and use the Free Transform tool or any of the Modify > Transform commands. When a list is resized, the rows of the list shrink horizontally, clipping any text within them. For more information about scroll bars, see "ScrollPane component" on page 1093.
Using styles with the List component
You can set style properties to change the appearance of a List component.
766
List component
A List component uses the following styles:
Style
themeColor
Theme Description
Halo The base color scheme of a component. Possible values are "haloGreen", "haloBlue", and "haloOrange". The value can be an array of two or more colors, for example, 0xFF00FF, 0xCC6699, and 0x996699. Unlike single-value color styles, alternatingRowColors does not accept color names; the values must be numeric color codes. By default, this style is not set and backgroundColor is used in its place for all rows. The default color is white and is defined on the class style declaration. The background color when the component's enabled property is set to "false". The List component uses a RectBorder instance as its border and responds to the styles defined on that class. A Boolean value that indicates whether the font specified in fontFamily is an embedded font. This style must be set to true if fontFamily refers to an embedded font. If this style is set to true and fontFamily does not refer to an embedded font, no text is displayed. [. . . ] This event object should contain the following properties:
Property
target type updatePacket
Description
Object; the resolver generating this event. XML object; the XML object that is about to be applied.
Returns
None.
Description
Event; called by the resolver component to make custom modifications immediately after the XML packet has been created for a new delta packet, and immediately before that packet is sent out using data binding. You can use this event handler to make custom modifications to the XML before sending the updated data to a connector.
Example
The following example adds the user authentication data to the XML packet:
on (beforeApplyUpdates) { // Add user authentication data. var userInfo = new XML(""+getUserId()+" "+getPassword()+""); xupdatePacket. firstChild. appendChild(userInfo); }
1512
XUpdateResolver component (Flash Professional only)
XUpdateResolver. deltaPacket
Availability
Flash Player 7.
Edition
Flash MX Professional 2004.
Usage
resolveData. deltaPacket
Description
Property; contains a description of the changes to the DataSet component. [. . . ]