Creating new components in Flex 3
Flex April 14th, 2009Recently I saw a screencast from Deepa Subramaniam at Max2008 on how to create new components in Flex 3 (link). I would urge everybody to watch this video if you're not familiar with this topic.
Something I noticed in this video was the use of Bindable metadata tag with event name specified. If you make a setter Bindable, then it's kinda of a performance loss to trigger the binding if the new value that's being set is the same as the old value. Here's a way to improve this:
Actionscript:
-
[Bindable(event="xChanged")]
-
public function get x():Number{ return _x; }
-
public function set x(value:Number):void{
-
if(_x != value){
-
...
-
dispatchEvent(new Event("xChanged"));
-
}
-
}
April 22nd, 2009 at 2:51 pm
People should read this.
May 22nd, 2009 at 4:07 pm
I will be coming back here again and again, and I will tell my friends as well. This is a great site.