Skip to main content
Inspiring
April 16, 2012
Beantwortet

How to Listen for when Native Application Opens

  • April 16, 2012
  • 2 Antworten
  • 619 Ansichten

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

Dieses Thema wurde für Antworten geschlossen.
Beste Antwort von 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

2 Antworten

anders-tblAntwort
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

Inspiring
April 16, 2012

Works perfectly thanks!