Programmatically detecting between Adobe Air and Adobe Flex in ActionScript 3.0
Asked Answered
D

1

9

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?

Digastric answered 12/2, 2010 at 2:4 Comment(0)
U
14
if (Capabilities.playerType == "Desktop") {
  trace("I'm running on AIR");
}

See the Capabilities documentation.

Unfinished answered 12/2, 2010 at 2:14 Comment(1)
The import for this is Flash.System.CapabilitiesDigastric

© 2022 - 2024 — McMap. All rights reserved.