There are icons asigned to Tree control for folderOpen, folderClose and for leaf nodes.The folder icon for folder open and close and one leaf icon.What if i want to change this default icons of Tree control.. its simple !.
The properties we got to use here is that:
folderOpenIcon -> for folder Open.
folderClosedIcon ->for folder close.
defaultLeafIcon ->for leaf icon.
Example:
<mx:Tree x=”10″ y=”10″ folderOpenIcon=”@Embed(‘images/fopen’)” ></mx:Tree>
Similarly for other properties..!


February 13, 2008 at 9:56 am |
Is it possible to use different folderOpenIcon’s / folderClosedIcon’s in a tree?
Can I override this behavior programmtically?
February 13, 2008 at 11:06 am |
HI MARCUS,
its possible ,first define the icons of type Class and assign them to nodes programatically as u required and setItemIcon is the methos we have to use of Tree class.
Example:
[Embed("assets/folder_table.png")]
private var FolderIcon1:Class;
[Embed("assets/folder_user.png")]
private var FolderIcon2:Class;
[Embed("assets/folder_wrench.png")]
private var FolderIcon3:Class;
//These are the folder icons iam assaining to three folders.with the code below.
private function init():void {
var nodeOne:XML = xmlListColl.getItemAt(0) as XML;
tree.setItemIcon(nodeOne, FolderIcon1, FolderIcon1);
// similarly set for other folders. here xmlListColl is my XML List for Tree.
}
END:
Try it, will work.or comment me.
December 3, 2008 at 4:14 pm |
…or in other words:
“Marcus, have a look at the adobe-website”?
no offense meant, but i think this single blog entry is quite useless… it doesnt provide any information, cause the properties are self-speaking (and there less space consuming than explained) and the first place to search for information is the adobe website… so its a bit frustrating looking around for help with icons for trees and then finding just a little bit of nothing.
sorry…
December 8, 2008 at 3:25 pm |
Hello there,
i am just a programmer trying to help other programmers and in deed get help from those programmers, and regarding my post i just described the properties of the Tree Class and their usage , yes you can get that from the adobe website and even from the Help given in the Flex Builder (if you are using one), but trust me there are some programmers who search on the other blogs then start from where its actually required. and finally do you require icons for the Tree ??, comment me if that is what you want , i will try to help you.
, thanks for the comment.
regards,
kumar.