If you are relying on the built in Flex binding mechanism, you may have run into this issue: The Binding won’t update its listeners if the value you are setting the property to is the same as the previous value. Put another way:
var a:Number = 10;
trace(a); //firing the getter which outputs 10.
a = 10; //firing the setter, bindings will not update listeners.
Do not rely on Flex to fire the propertyChangeEvent w/ respect to the related getter/setter by using the default
[Bindable] metatag. Instead modify your class with these steps:
- Instead of
[Bindable (event="myCustomEventName")]on your getter.
- Make sure the related setter dispatches the event like so:
- Also making sure to add
[Event (name="myCustomEventName", type="flash.events.Event")]for any external listeners.
- Implement custom logic on the listeners in questions so that they can be updated via the event rather than the binding.*
How this might assist you? Well rather than relying on having to circumvent the binding not firing when setting the property to the same value, you could have additional listeners for that custom event since it is fired regardless of the previous set value.
*Although I do use this method on all of my getters/setters, I would not necessarily implement the external logic on all of the bound listeners. I would only do so in cases where the property needs to be updated regardless of whether or not the new value is the same as its previously set value.