Skip to main content
Inspiring
October 28, 2013
Question

Stage onClick problem

  • October 28, 2013
  • 1 reply
  • 1205 views
stage.addEventListener(MouseEvent.MOUSE_DOWN, onMouseDown)
I tried use this to close a drop down menu whenver user click anywhere besides the menu button.
But it seems to me the 'stage' area pretty much covers only area that has nothing on it, example: the little 'padding' area outside the main movie, that's practically useless I need the user be able to click on ANYWHERE except the button and the menu area, and then trigger function to close the menu.
I google around but can't find anything useful,  it seem to me in AS2 there is onreleaseoutside event? Why wouldn't they have same thing on AS3? and what's the best solution for this?  I think on Javascript this is pretty easy to accomplish?
Thank you.

This topic has been closed for replies.

1 reply

Inspiring
October 28, 2013

Hi!

I just tried this method, I get error however,

1061: Call to a possibly undefined method contains through a reference with static type flash.display:SimpleButton.

strange thing is it say 'contains' is undefined but in Flash its text is blue so 'contains' has to be an AS term..

Inspiring
October 28, 2013

Enable debugging in your Publishing options and show the Line of Code that produces the error