# Can I target AIR and Flash simultaneously?

**URL:** https://forum.kirupa.com/t/can-i-target-air-and-flash-simultaneously/254655
**Category:** flash
**Created:** [March 13, 2008, 9:57pm UTC](https://forum.kirupa.com/t/can-i-target-air-and-flash-simultaneously/254655 "2008-03-13T21:57:17Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Rezmason](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/rezmason/32/30447_2.png) [@Rezmason](https://forum.kirupa.com/u/Rezmason)
#### Post date: [March 13, 2008, 9:57pm UTC](https://forum.kirupa.com/t/can-i-target-air-and-flash-simultaneously/254655/1 "2008-03-13T21:57:17Z")

</div>

I’m working on a long project that I just brought over to the AIR platform. The problem is, I’m now using classes that the Flash player doesn’t recognize. The player throws errors in global \_\_init(), probably when it’s reading in the import statements.

It’d be nice if there was a way to tell from within the program whether it’s running in Flash or on AIR. I could probably look at the security sandbox type– AIR has a very different sandbox. But even then, I need a way to gain access to the AIR-specific classes _after_ I run the AIR test:

```auto
var classA:Class, classB:Class, classC:Class;
if (this is an AIR app) {
classA = getClass("AIRClassA");
classB = getClass("AIRClassB");
classC = getClass("AIRClassC");
}

```

Something like that. I’m guessing GetDefinitionByName() will work, but I’m not sure. Any ideas?
