Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Programmatically detecting between Adobe Air and Adobe Flex in ActionScript 3.0

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?

like image 929
Joshua Avatar asked Feb 12 '10 02:02

Joshua


1 Answers

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

See the Capabilities documentation.

like image 155
Michael Greene Avatar answered Nov 03 '22 20:11

Michael Greene