2 Replies Latest reply on Aug 5, 2010 11:23 AM by thilgen

    Appending files to an Air Runtime

    flexstone Level 1

      I have an Air app that will contain thousands of content files. What I would like to do is compile the App without the folder containing these files and then later append them since they will change over time while the App may not. Is this possible using  amxmlc or any other tool ?

        • 1. Re: Appending files to an Air Runtime
          snorky Level 1

          I'd like to know more about this too as it seems like a very handy thing to be able to do.

           

          I know the .air format is basically a .zip archive so I tried renaming a .air file to .zip. then I added a folder with files to the archive. then I renamed it back to .air. BUT when I tried to install the .air file it failed saying it was corrupted. so I deleted the folder and the .air file worked again. this is probably part of the security/signing/etc.

          • 2. Re: Appending files to an Air Runtime
            thilgen Level 4

            Snorky is correct - when an AIR file is created - it is "sealed" and locked by the signing process - attempts to crack open an AIR file and modify its contents will result in an error when attempting to install.

             

            One possible solution is to download and store your media files as part of your applications' first launch - or as part of your application's periodic check for new content - and to store that data in the the File.documentsDirectory (or a sub-directory).

             

            You can also pull down and store content in the File.applicationStorageDirectory - but be warned that this should only be used for content that can be accessed by all users of your application - whereas File.documentsDirectory is per-user storage.

             

            Hope this helps.

             

            Chris Thilgen

            AIR Engineering