title: What is the best way to streamline the process of publishing Flash CS6 AS3 code for android, iphone, swf and air from a single flash project?
body: <p>I have a flash project (AS3) that I am developing using Flash CS6. I am developing for iOS devices, Android devices, desktop (air) and web browser (swf). So far I have been able to use a single codebase making only a few modifications when publishing to each for example - </p>
  
  <p>I have some code that handles exiting the application on a mobile device when the user presses the home button that uses the flash.desktop.NativeApplication class. Obviously this is not needed for the desktop or for the swf version so when i come to publish for these I comment out the relevant import statements and code that listens for the home button being pushed. </p>
  
  <p>I also have a config.xml file that loads some settings, for swf this is not in the same directory as the swf file so pass in the location of this config file when the swf object is loaded (flashvars). But for all other versions the path to this file is simply config.xml so I comment out the code that handles the loading of flashvars - </p>
  
  <pre><code>allFlashVars = LoaderInfo(this.root.loaderInfo).parameters;
  webroot = String(allFlashVars["webroot"])
  </code></pre>
  
  <p>There are a few other differences between the versions that requires similar steps which I have made sure to note in a document for myself to remember  and for other developers. </p>
  
  <p>However I know that this is not the ideal solution and think there must be a better way to manage this. </p>
  
  <p>Does anyone know of any good advice / best practice for handling such a situation?</p>
  
  <p>thanks</p>