Skip to main content
Known Participant
October 27, 2012
Question

Closing Popup through button -> doubleclick leads to crash with strage exit code

  • October 27, 2012
  • 2 replies
  • 603 views

I have a popup with a button in it...

the button overrides...

        override protected function clickHandler(event:MouseEvent):void

        {

           if(buttonConfig)

            {

                dispatchEvent(new ConfigurableButtonEvent(ConfigurableButtonEvent.CLICKED, buttonConfig, true));

            }

        }

the click is handled somewhere else

...

if(popup)

{

          popup.removeEventListener(ConfigurableButtonEvent.CLICKED, handlePopupButtonClicked);

          popup.close();

}

popup = null;

...

When I doubleclick the button the app exits with an error code:

[AIR Debug Launcher]: Process finished with exit code -1.073.741.819

No exception, no stackTrace... nothing.... just the strange error code

This can be fixed through a change in the buttons clickHandler:

override protected function clickHandler(event:MouseEvent):void

{

     enabled = false; // ADDED

     setTimeout(resetEnabled, 100); // ADDED

      if(buttonConfig)

      {

          dispatchEvent(new ConfigurableButtonEvent(ConfigurableButtonEvent.CLICKED, buttonConfig, true));

       }

}

// ADDED

                    private function resetEnabled():void

                    {

         enabled = true;

                    }

Has anyone an idea why this happens ...

This topic has been closed for replies.

2 replies

Mark.fromOP
Inspiring
October 28, 2012

Maybe since its a double click the first click is handled on the button and then the second click is handled on the stage but they both try to reference something that only one gets access to since the first click removes it? Just speculating.

Known Participant
October 28, 2012

That was in a part also my idea... for this I disabled the button for the 100ms... but I don't understand why I don't get a real exception/error from air...

But the second click shouldn't be handled form somewhere as it is a custom event which is dispatched and I added trace and so I can say the error happens before the overridden clickHandler is called from the second click...