Resending in case this was missed.

Hi there,
 
I have a custom AS component that seems to generate a script time-out error when I use databinding to set one of its params.
It works fine if I hard code the param value.
 
Any ideas as to why this may be happening ? (code pasted below)
 
TIA

- superabe

 
Component code(RatingCell.as)
=======================
 
class RatingCell extends HBox{
 
 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




SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




Reply via email to