Flex Mouse Events, Effects and functions

While adding some effects to a flex application, I noticed some strange behaviour. All of a sudden I noticed a function I had set to fire on the click event of a button was no longer firing.

I originally thought the effect intercepted the call in some way, but it turns out I had the effect set to fire on the mouseDownEffect. Changing the effect to fire on the mouseUpEffect brought the function back in to play.

A mouseDownEffect apparently changes the button before the click event fires. Hope this helps someone.

This is bad

view plain print about
1<mx:WipeLeft id="aWipeEffect" duration="1000" />
2<mx:Button label="Change More Text" click="changeText();" mouseDownEffect="aWipeEffect" />

This is good

view plain print about
1<mx:WipeLeft id="aWipeEffect" duration="1000" />
2<mx:Button label="Change More Text" click="changeText();" mouseUpEffect="aWipeEffect" />

4174 Views Print Print Comments (0) Flex

There are no comments for this entry.

Add Comment Subscribe to Comments