icon in the list component AS3- Is it possible
I am wondering if there is a way to add icons in the list component.

I am wondering if there is a way to add icons in the list component.

Hi, res.
Something like this should do the trick.
AS3 code:
import fl.data.DataProvider;
import fl.controls.List;
var icons:Vector.<Class> = new <Class>
[
Square, // linkage name in the Library
Circle,
Triangle
];
var i:int;
var total:int;
var totalNewItems:uint = 10;
list.iconField = "iconSource";
list1.iconField = "iconSource";
// replace current items
for (i = 0, total = list.dataProvider.length; i < total; i++)
list.dataProvider.replaceItemAt({iconSource:icons[i % icons.length], label:"Item " + i}, i);
// add new items
for (i = 0; i < totalNewItems; i++)
list1.dataProvider.addItemAt({iconSource:icons[i % icons.length], label:"Item " + i}, i);
FLA download:
animate_cc_as3_list_component.zip - Google Drive
Regards,
JC
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.