# Auto-detect flash environment (browser or AIR)

**URL:** https://forum.kirupa.com/t/auto-detect-flash-environment-browser-or-air/276358
**Category:** flash
**Created:** [November 26, 2008, 5:04am UTC](https://forum.kirupa.com/t/auto-detect-flash-environment-browser-or-air/276358 "2008-11-26T05:04:50Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![cauchy](https://avatars.discourse-cdn.com/v4/letter/c/a88e57/32.png) [@cauchy](https://forum.kirupa.com/u/cauchy)
#### Post date: [November 26, 2008, 5:04am UTC](https://forum.kirupa.com/t/auto-detect-flash-environment-browser-or-air/276358/1 "2008-11-26T05:04:50Z")

</div>

I’d like to use the same code base for both desktop AIR and browser plugin applications, with some changes in the manner in which data is loaded and saved. Ideally, I would like to auto-detect the current environment so I know where to look for the data to be loaded, either from the filesystem or from a URL. Is there a simple test that can accomplish this without relying on a hack? Thanks in advance.
