hai,
I' like to change the default icon for the tree based on some condition. the code which i'm using right now doen't work.. pls tell me where i go wrong
<?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.