Skip to main content
Inspiring
April 16, 2012
Answered

How to Listen for when Native Application Opens

  • April 16, 2012
  • 1 reply
  • 619 views

Hi,

I’m sure this is pretty trivial so I am sorry if this is an easy question, AS3 is far from my strong point.

I have had a look here http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/desktop/NativeApplication.html but I'm not 100% sure which class will help me achieve what I want to do and how to implement that code.

I just want to run a function when the native application re-opens?

If someone could help me out or let me know if this is possible that would be great.

Thanks,

Alex

This topic has been closed for replies.
Correct answer anders-tbl

Hi Alex!

Use the Event.ACTIVATE in nativeApplication like this:

NativeApplication.nativeApplication.addEventListener(Event.ACTIVATE, onActivate);

function onActivate(e:Event):void {

     // Whatever you like to do here

}

Have fun!

//anders

1 reply

anders-tblCorrect answer
Inspiring
April 16, 2012

Hi Alex!

Use the Event.ACTIVATE in nativeApplication like this:

NativeApplication.nativeApplication.addEventListener(Event.ACTIVATE, onActivate);

function onActivate(e:Event):void {

     // Whatever you like to do here

}

Have fun!

//anders

vestaxpdxAuthor
Inspiring
April 16, 2012

Works perfectly thanks!