I use the iconFunction. Embed the images. You can change it this way
dependant on any attribute you want.

<mx:Script>
<![CDATA[
private function getIconForNode(item:Object):Class{

  var iconSymbol:String = [EMAIL PROTECTED];
  if (iconSymbol !=""){
   switch(iconSymbol){
    case "myimage":
     return myimage;
     break;
    }

  }

[Bindable]
[Embed(source="myimage.png")]
public var Tasks:Class;

]]>
</mx:Script>


<mx:Tree showRoot="false" iconFunction="getIconForNode" id="Tree0"
labelField="@label" dataProvider="{dataSource}" >
..
..
<mx:XML>
        <treeItem label="root" icon="myimage">
</mx:XML>

</mx:Tree>

Hope this helps, and clear enough.

jason






-----Message d'origine-----
De : flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] la
part de Graham Weldon
Envoyé : mercredi 10 mai 2006 12:00
À : flexcoders@yahoogroups.com
Objet : [flexcoders] mx:Tree control icon setting (f2b3)


Hey everyone,

To be honest, I've not completely read the changes since Beta2, but
thought I would ask:
Has the ability to individually set icons for tree nodes been made
available? If not, is it a feature that is planned for inclusion with
Flex 2.0?
To clarify: Can I set a specific icon per item in the tree, not based on
whether it is a folder of item, but perhaps based on some data in the
dataProvider:

<mx:Tree
    labelField="theLabel"
    iconField="theIcon">
    ...
    ...
    <mx:XML>
        <treeItem theLabel="root" theIcon="/images/rootIcon.png">
            <treeItem theLabel="childNode" theIcon="/images/001.png"/>
            <treeItem theLabel="another node" theIcon="/images/004.png">
                <treeItem theLabel="thing"
theIcon="/images/thingImages/thing.png"/>
                <treeItem theLabel="thing"
theIcon="/images/thingImages/thing.png"/>
                <treeItem theLabel="thing"
theIcon="/images/thingImages/thing.png"/>
                <treeItem theLabel="thing"
theIcon="/images/thingImages/thing.png"/>
                <treeItem theLabel="thing"
theIcon="/images/thingImages/thing.png"/>
                <treeItem theLabel="thing"
theIcon="/images/thingImages/thing.png"/>
            </treeItem>
        </treeItem>
    </mx:XML>
    ...
    ...
</mx:Tree>

I hope this illustrates the effect I am trying to produce.

Regards,
Graham Weldon




--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com



SPONSORED LINKS Web site design development Computer software development
Software design and development
Macromedia flex Software development best practice



YAHOO! GROUPS LINKS

Visit your group "flexcoders" on the web.

To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.





--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




Reply via email to