So, it appears that if you apply the [Bindable] metadata to a
property, Flex inserts quite a bit of logic that may not be obvious
(and certainly doesn't appear to be documented). I haven't checked the
generated AS yet, but I get the impression it does these things "for you":
- creates getters/setters if you don't have them.
- adds a dispatchEvent at the end of the setter (PropertyChangeEvent).
- adds logic to the beginning of the setter that basically does this:
if (value != get myProperty)
{
// execute whatever setter logic you have...
}
My question: is there anyway to avoid this logic or control it in
anyway? I'm guessing no... if I'm right, is there any way to cancel
the [Bindable] metadata you put on a class for an individual property,
or do I just have to go through and put the [Bindable] on each property?
The reason I'm asking: I recently changed some of my API from having a
pause()/unpause() pair of methods to having a paused boolean property.
The bindable logic where it only calls the setter *if* the getter
value is different actually revealed a bug in my code where i was
actually depending on unpause gettng called twice (whereas with the
bindable property, it only got called once).
Troy.