1 Reply Latest reply on Mar 17, 2008 2:31 AM by anirudhs

    Understanding the AIR Sandbox?

    CommunityDU Level 1
      Well I am learning the hard way that you can't just take any old Flash sample and make it work in AIR.

      I have had mixed results to date, with one issues being sample Flash files that use AS2 components not working.

      But now this...

      I am trying out this sample http://www.flash-db.com/Tutorials/loadingAS3/loadingData.php?page=4

      And got the PHP/MySQL sample to work as expected in Flash, converted to Flash AIR, works as well, debug as ADL, works well also, however when making a final AIR app, it does not fully work, and the images are missing.

      I am not expecting anyone to help me decode, fix the sample code, what I need to know is what really are the underlying difference between Flash SWF, ADL, and a AIR app, to make this happen, something I think may be answered by understanding the AIR sandbox if that is the correct term.

      This is in Flash CS3/AS3 and AIR 1.0 update and player.

        • 1. Re: Understanding the AIR Sandbox?
          anirudhs Level 2

          AIR has an additional sandbox called the application sandbox. All AIR related functionality like file access can only be accessed by content in the application sandbox. Content coming in over from the network (like HTML in an iframe) is not in the application sandbox.

          Read more about this at http://www.adobe.com/devnet/air/articles/introduction_to_air_security.html

          In AIR, URLs passed to URLRequest and others can read from the application installation directory and an application storage directory by prefixing app: and app-storage: as protocol specifiers. I think by default, it reads from app:. So if you do a URLRequest("loaddb.php") it will read the code of the php file (if you've packaged the php file in your air app). But a URLRequest(" http://localhost/loaddb.php") should work.

          The final .air file is a zip file which includes the main swf, an application descriptor and assets for the program. ADL and the final yourairapp.exe differs when it comes to Updater.update() (self update API) and the app: and app-storage: location.