Hai,
I have alreadt posted a question regarding this.. I want to change the default icon of the node of a tree dynamically.. i am now using a iconFunction to do it, but it doesnt work.. can anybody help me with this?
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml">
<mx:Script>
<![CDATA[
[Embed(source="l_green.gif")]
<mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml">
<mx:Script>
<![CDATA[
[Embed(source="l_green.gif")]
var myIcon : String;
function iconFunc(item)
{
if (item.label == "Food") return myIcon;
else return
myTree.getStyle("defaultLeafIcon");
function iconFunc(item)
{
if (item.label == "Food") return myIcon;
else return
myTree.getStyle("defaultLeafIcon");
}
]]>
</mx:Script>
<mx:Panel height="100%" width="40%" title="CATALOG">
<mx:Tree id="myTree" height="100%" width="100%" iconFunction="iconFunc" defaultLeafIcon="@Embed('assets/online1.png')" disclosureClosedIcon="@Embed('plus.png')" disclosureOpenIcon="@Embed('minus.png')" folderOpenIcon="@Embed('l_red.gif')" folderClosedIcon="@Embed('l_red.gif')" >
<mx:dataProvider>
<mx:XML>
:
]]>
</mx:Script>
<mx:Panel height="100%" width="40%" title="CATALOG">
<mx:Tree id="myTree" height="100%" width="100%" iconFunction="iconFunc" defaultLeafIcon="@Embed('assets/online1.png')" disclosureClosedIcon="@Embed('plus.png')" disclosureOpenIcon="@Embed('minus.png')" folderOpenIcon="@Embed('l_red.gif')" folderClosedIcon="@Embed('l_red.gif')" >
<mx:dataProvider>
<mx:XML>
:
:
</mx:XML>
</mx:dataProvider>
</mx:Tree>
</mx:XML>
</mx:dataProvider>
</mx:Tree>
</mx:Panel>
</mx:Application>
Yahoo! Messenger - Communicate instantly..."Ping" your friends today! Download Messenger Now
Yahoo! Groups Links
- To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.