views:

209

answers:

1

I have some shared code between an Adobe AIR App and an Adobe Flex App.

On one line of this code, the program must behave differently depending on if it is running within the Air runtime, or the Flex runtime.

How can I programmatically detect the difference?

+8  A: 
if (Capabilities.playerType == "Desktop") {
  trace("I'm running on AIR");
}

See the Capabilities documentation.

Michael Greene
The import for this is Flash.System.Capabilities
Joshua