Author
Flex 3 : Dispatching an event
Ravi Kiran V
Ranch Hand
Joined: Apr 18, 2009
Messages: 1203
posted Jan 20, 2010 10:14:58
Hi
I am trying to Dispatch an event here .
My requirement is that , on mouseover event of a Button , i am trying to generate a event of type Mouse click and call a function .
This is my own written code and i dont like this way as you can see from the above code that i am using MouseEvent.CLICK number of times .
Please tell me how can this function handleMouseOver can be improved
I tried to change the world, but I couldn’t find the source code
Paul Sturrock
Bartender
Joined: Apr 14, 2004
Messages: 8544
posted Jan 21, 2010 03:12:40
MouseEvent subclasses Event. Why not just write one event handling function that handles events and add it as the event listener for both mouse over and click events? That would save you having to reregister your click event handler and redispatch a mouse click event.
JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Ravi Kiran V
Ranch Hand
Joined: Apr 18, 2009
Messages: 1203
posted Jan 21, 2010 08:42:50
Thank you i remodeled my code.
I tried to change the world, but I couldn’t find the source code