On 7/28/05, Archibald Scatflinger <[EMAIL PROTECTED]> wrote:

> I do not want to use implicit getter/setters because I want the
> components property to be bindable.

To make the component's property bindable, specify a "ChangeEvent" for
the property and dispatch the event when the value changes.

e.g.

<?xml version="1.0"?>
<mx:Box xmlns:mx="http://www.macromedia.com/2003/mxml"; xmlns="*">
  <mx:Label text="{labelText}" />
  <mx:Script>

    // Storage for 'labelText' property
    private var _labelText:String = "";

    [ChangeEvent("labelTextChange")]
    public function get labelText():String
    {
      return _labelText;
    }
    public function set labelText(value:String):Void
    {
      if (value != _labelText)
      {
        _labelText = value;
        dispatchEvent({type: "labelTextChange"});
      }
    }
  </mx:Script>
</mx:Box>

When labelText is modified, the component dispatches an event to
trigger binding.  Check out the generated AS to see how this works.

Manish


--
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