0 Replies Latest reply on Oct 22, 2007 12:33 PM by Nathanael86

    Can't capture button clicked event (AS 2.0)

      I've written a class that among other things displays a popup window which has a button and a combo box. For some reason I can't add an event listener to the button to capture 'click' events.

      Well, to be more precise I seem to be able to add the event listener, but it never fires. I've attached the code, the relevant portion is private function complete(objEvt:Object), where I call addEventListener on my button.

      I noticed something in the documentation about the onRelease event, I tried capturing that but it didn't work either.

      I was able to override the button's onRelease function by saying myButton.OnRelease = this.AddNewUser. This isn't really a great solution for me since AddNewUser runs in the context of the button (this == myButton) instead of under my AddUser class (this == AddUser object).

      Oh, I should point out that I'm working in AS 2.0 and it's not an option to move to AS 3.0.