- superabe
private var _rating:Number;
private var maxRating:Number = 5;
[Embed( "assets/images/rating_on.png" )]
private var ratingOn:String;
[Embed( "assets/images/rating_off.png" )]
private var ratingOff:String;
public function RatingCell(){
}
public function get rating():Number{
return this._rating;
}
public function set rating(value:Number){
if(value > maxRating){
value = maxRating;
}
this._rating = value;
}
private function createChildren():Void{
super.createChildren();
Echo.debug("Rating Cell : createChildren");
Echo.debug("rating = " + rating);
//create active icon
for(var i:Number=0;i<rating;i++){
this.createChild(Image,undefined,{source:ratingOn}) ;
}
//create inactive icon
var startCounter:Number = rating;
while(startCounter <= maxRating){
this.createChild(Image,undefined,{source:ratingOff}) ;
startCounter++;
}
}
}
Usage (Main.mxml)
================
<mx:Script>
<![CDATA[
var tempRating:Number = 5;
]]>
</mx:Script>
<renderer:RatingCell rating="5" horizontalGap="1"/> // this works fine
<renderer:RatingCell rating="{tempRating}" horizontalGap="1"/> // this prompts script timeout error
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
| Web site design development | Computer software development | Software design and development |
| Macromedia flex | Software development best practice |
YAHOO! GROUPS LINKS
- Visit your group "flexcoders" on the web.
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

