Amy is right,

the code was:

override public function set data(value:Object):void
{
   super.data = value;
}

maybe its preferable to have :

override public function set data(value:Object):void
{
   if (value != null)
   {
      super.data = value;
   }
}


What i usually do is check for null and then if not do any custom logic:

override public function set data(value:Object):void
{
   if (value != null)
   {
      super.data = value;

      //pseudo
      if (value is supposed to be shown in red)
      {
         make the background red
      }
      else
      {
          //reset component to solve renderer re-use issues
          reset color to Grey
      }
   }
}


On Mon, Jan 26, 2009 at 3:03 PM, Amy <amyblankens...@bellsouth.net> wrote:

>   --- In flexcoders@yahoogroups.com <flexcoders%40yahoogroups.com>, Alex
> Harui <aha...@...> wrote:
> >
> > If your override is exactly as you posted:
> > override public function set data(value:Object):void { }
> >
> > then the override never passed the value to the base class
> implementation so the value wasn't stored and the debugger will read
> from the "get data()" function and show you a null.
> >
> > In the base class the setter does this:
> >
> > _data = value;
> >
> > And the getter does this:
> >
> > return _data;
> >
> > where _data is defined as:
> >
> > private var _data:Object;
>
> I'm pretty sure the function he posted included
> super.data=value;
>
> Wouldn't that pass the value to the base class implementation?
>
> Just making sure I'm not confused and he doesn't get unnecessarily
> confused on this.
>
> Thanks;
>
> Amy
>
>  
>



-- 
Fotis Chatzinikos, Ph.D.
Founder,
Phinnovation
fotis.chatzini...@gmail.com,

Reply via email to