There is an example in the doc for this at:
 
 
Stephen


From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Matt Chotin
Sent: Wednesday, May 11, 2005 10:12 PM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] HOw to change the foldericon of the tree dynamically acording to some condition?

iconFunction should return the symbol that should be used as the icon.  So you would embed your image and then return it as appropriate:

 

[Embed(source=”myBookIcon.jpg”)]

var bookIcon : String;

 

function iconFunc(item)

{

  if (item.label == “books”) return bookIcon;

  else return someOtherIconName;

}

 

If you want to use the original icons if yours isn’t appropriate you can get the defaultLeafIcon, folderOpenIcon, and folderClosedIcon (myTree.getStyle(“defaultLeafIcon”))

 

HTH,

Matt

 


From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of nithya karthik
Sent: Wednesday, May 11, 2005 2:41 AM
To: flexcoders
Subject: [flexcoders] HOw to change the foldericon of the tree dynamically acording to some condition?

 

hai,

      I'd like to know how to change the folderopen and folderclose icon of a tree control dynamically according to some condition (say when the node label is "books", i want the folderopenIcon to be 'books.png'......)

 

help me with some code for this....

 

How should i use the IconFuntion in a tree?

 

thanks,

nithya


Yahoo! Messenger - Communicate instantly..."Ping" your friends today! Download Messenger Now



Yahoo! Groups Links

Reply via email to