Wednesday, September 8, 2010

Adding a movieclip to a scrolling component list!

a solution for adding a movieclip to a scrolling component list!

http://livedocs.adobe.com/flash/9.0/...html#iconField

Check out the entry on "IconField". Note that in the example, RedBox would be the instance name of your MovieClip.

Here's the example it gives:

The following example creates a list with an icon for each item. A symbol named RedBox must exist in the library and have "Export for ActionScript" toggled in its symbol properties:

PHP Code:
import fl.data.DataProvider;
import fl.controls.List;

var
dp:DataProvider = new DataProvider();
dp.addItem( { iconSource:RedBox, label:"Item 1" } );
dp.addItem( { iconSource:RedBox, label:"Item 2" } );
dp.addItem( { iconSource:RedBox, label:"Item 3" } );

var list:List = new List();
list.
iconField = "iconSource";
list.
dataProvider = dp;
addChild(list);