This is the most annoying point I have reached with AS3 yet. AS3 does not have an onReleaseOutside event, something I really needed for a menu to hide if the user clicked away from it. One implementation that I did find here involves a deeper understanding of the event bubbling mechanism. My own implementation is simpler and I just listen to a global application mouse click and see if my menu is down or not. However i do imagine lack of this event would make many developers go nuts. What sucks even more is that event isnt even available on the Flex framework. Maybe something we can ask for in 2.1 ?
7 thoughts on “AS3: Where is my onReleaseOutside”
And here can we find your implementation?
The code is as simple as:
Actually this is an old post and I recommend the one linked to the tip of the day post by sinocular.
this will be invoked if the user does a click anywhere on the stage. What is to stop the user clicking on something that does not take a click, like a logo for example, that would fire your function.
As long as the element clicked on does not capture the event, the mouse up event will bubble to the stage and the eventListener will be executed.
Thanks this solve. So simple, so useful.
I meet the problem today.