views:

177

answers:

1

I've noticed that there are certain AIR options that don't work in the flash test player (the one that previews movies when you Ctrl + enter).

One example is NativeApplication.startAtLogin.

If it is called from the standalone player (double clicking on the swf file, for example) it works, but if i test it on the flash ide it will throw an error.

Is there a way to detect if I'm testing the movie in the ide and so avoiding to use that property?

+1  A: 

flash.system.Capabilities has a property named playerType, which is set to "External" when using the test player and "Desktop" when using AIR. So,

import flash.system.Capabilities;

...

if (Capabilities.playerType != 'External')
  // do stuff that don't work in the test player
if (Capabilities.playerType == 'Desktop')
  // do stuff that works only in AIR
kkyy

related questions