
Welcome Guest
|
#1
|
||||
|
||||
|
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}); Actionscript:
the_list.defaultIcon = "listIcon"; 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); Let me know what you think. Sample file included. |
«
Previous Thread
|
Next Thread
»
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
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 |





