Hi,

I'm trying to set the icon of the nodes on my tree based on some 
logic and am using the iconFunction tag to do this but it doesn't 
seem to work. The tree is populated from a returned Array of Value 
objects from a remoteObject call. One of the variables within each 
Value Object is called percent_full and is a number between 0 and 
100 inclusive. Here is the icon function I have used:

      [Embed("assets/vgreen.png")] 
      var greenIcon:String; 
      [Embed("assets/vamber.png")] 
      var amberIcon:String;
      [Embed("assets/vred.png")] 
      var redIcon:String;  
public function setIcon(item){
        var type:Number = item.percent_full;
        if (type >= 0 && type < 33){
                return redIcon;
        }else if(type >= 33 && type < 66){
                return amberIcon;
        }else if(type >= 66 && type <= 100){
                return greenIcon;
        }
}

I get green Icons for ever node!

Regards,

Iain





------------------------ Yahoo! Groups Sponsor --------------------~--> 
<font face=arial size=-1><a 
href="http://us.ard.yahoo.com/SIG=12h72a7ed/M=362335.6886445.7839731.1510227/D=groups/S=1705007207:TM/Y=YAHOO/EXP=1124193327/A=2894361/R=0/SIG=13jmebhbo/*http://www.networkforgood.org/topics/education/digitaldivide/?source=YAHOO&cmpgn=GRP&RTP=http://groups.yahoo.com/";>In
 low income neighborhoods, 84% do not own computers. At Network for Good, help 
bridge the Digital Divide!</a>.</font>
--------------------------------------------------------------------~-> 

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
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:
    http://docs.yahoo.com/info/terms/
 


Reply via email to