views:

21

answers:

1

I've got a Flex Web project and a Flex AIR project that use a common code-base. The common code defines several run-time loaded Flex Modules. I want the Flex Modules to behave differently depending on whether the running base application is WEB or AIR. What is the proper method for determining from the module code whether the module is running in a WEB or AIR application?

(I found that Security.sandboxType.toString() returns "application", but I haven't found anything better in the documentation, yet.)

A: 

Google is your Friend:

http://stackoverflow.com/questions/2601904/how-to-check-if-a-swf-is-running-as-an-air-app

Use the Capabilities class:

> import flash.system.Capabilities;
> 
> switch (Capabilities.playerType) {
>     case 'Desktop':
>         //air runtime
>         break;
>     case 'PlugIn':
>     case 'ActiveX':
>         //browser
>         break; }
www.Flextras.com
Actually, stackoverflow and you deliver better answers without all the noise. Thanks!
Michael Prescott
I Googled it. ;) The answer just happened to be in a previous StackOverflow question. I couldn't remember it off the top of my head.
www.Flextras.com