LOADING
Loading
Hi , welcome back.
LogoutLOGOUT
 
  Lost password?  
Hi
 




 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 12-11-2006, 04:15 PM
tristian's Avatar
tristian tristian is offline
Registered User
 
Join Date: Mar 2006
Location: UK
Posts: 41
Rep Power: 0
tristian is on a distinguished road
Dynamically Coloured Icons For List Component

Hello.
I recently came across a problem whilst trying to set different coloured icons for each row of the list component and couldn't find any solution.

In brief this is what I came up with...

1. Add a list component to the stage, lets call it 'the_list'

2. Add your items to the list component and include a colour field:
Actionscript:
the_list.addItem({label:"Mable", data:1, colour:0x009966});
3. Specify the Linkage ID to the movie clip to act as icon:
Actionscript:
the_list.defaultIcon = "listIcon";
4. Create a new movie clip. Call it 'listIcon' and tick ' Export for Actionscript'.

5. Add this to the timeline of the listIcon movie clip:
Actionscript:
// get colour from item object
var categoryColour = this._parent.item.colour;
//colour object
colour = new Color(this);
// set color
colour.setRGB(categoryColour);
6. Publish.

Let me know what you think. Sample file included.
Attached Files
File Type: zip Dynamically_coloured_icons_list_box.zip (150.4 KB, 32 views)
Reply With Quote
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Componentsforflash.net announces Highscore Component henrike New Softwares 1 05-18-2007 08:56 AM
component in component trouble simong Actionscript 1 Components 5 06-15-2006 12:12 PM
creating homemade component dynamically radicalFish Actionscript 2.0 Components 2 12-15-2005 11:52 AM
Install custom component within the Component Panel? redP Flash Components v0 1 07-08-2004 06:08 PM
component headquarters emehmedovic Flash Components v0 1 12-12-2002 11:11 PM




All times are GMT. The time now is 11:12 AM.