August 9, 2005

Adding Icons to a List Component

I haven't done too much with Flash Communication Server, but I had fun on a project building a chat application without using the built-in components.

One of the requests I had was to have an icon of sorts appear next to a moderators name in a list component that was logged into the chat.

So a little trial and error eventually lead me to search online and finally came to the code below:

Create a list called myList;

Create a MovieClip and make sure the linkage ID is named "myIcon"

Cut and paste the following code:

myData = [{label:"Label1",data:"Data1",icon:"myIcon"}];
myList.iconField = "icon";
myList.dataProvider = myData;

No comments: