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

1
2
3
4
5
6
7
8
[Bindable(event="xChanged")]
public function get x():Number{ return _x; }
public function set x(value:Number):void{
if(_x != value){
...
dispatchEvent(new Event("xChanged"));
}
}
pixel Creating new components in Flex 3
No TweetBacks yet. (Be the first to Tweet this post)