Flash CS3 Documentation |
|||
| ActionScript 2.0 Components Language Reference > List component > List.setPropertiesAt() | |||
Flash Player 6 (6.0.79.0).
Flash MX 2004.
listInstance.setPropertiesAt(index,styleObj)
index A number greater than 0 or less than List.length indicating the index of the item to change.
styleObj An object that enumerates the properties and values to set.
Nothing.
Method; applies the specified properties to the specified item. The supported properties are icon and backgroundColor.
The following example changes the background color of the third item to red and gives it an icon. To try this code, drag a List component to the Stage and give it the instance name my_list. Next, add a MovieClip/Graphic symbol to the library with a linkage identifier of "file". Add the following code to Frame 1 in the timeline:
var my_list:mx.controls.List;
my_list.setSize(200, 100);
my_list.addItem({data:"flash", label:"Flash"});
my_list.addItem({data:"dreamweaver", label:"Dreamweaver"});
my_list.addItem({data:"coldfusion", label:"ColdFusion"});
my_list.setPropertiesAt(2, {backgroundColor:0xFF0000, icon: "file"});
Flash CS3
Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/flash/9.0/main/00003195.html