When building a component class and using the recommended method of providing access to properties with getter and setter functions you may find that you are unable to bind to these properties. It's actually rather trivial to enable binding but perhaps not overly obvious. All you need to do is add [Bindable] before the getter function.
private var _myVar:String;
[Bindable] public function get myVar():String
{
return this._myVar;
}
public function set myVar( value:String ):void
{
this._myVar = value;
}
No comments:
Post a Comment
Thank you for the comments.