6 Replies Latest reply on Jul 30, 2009 10:33 AM by evan64568745845674534

    Flex application running under AIR takes a long, long time to start.

    PauloBonza

      I have a flex application which runs on a desktop under AIR. The application has an assets folder with 3,500 mp3 soundclips totalling about 50MB. The problem is, the application takes around 90 seconds to load. I'm sure that AIR is scanning the application folder and doing something with the contents because if I delete the assets folder it loads in about 5 seconds. Does anyone know why AIR/Flex would do this, and why it doesn't exhibit the same problem if I run or debug in Flexbuilder on eclipse? It's making my killer app unusable!

      Thanks

      Paulo

        • 1. Re: Flex application running under AIR takes a long, long time to start.
          EgorKDie

          Probably because it's trying to work out if it needs to update itself.

           

          By the sounds of things, you are keeping all the assets in the same folder as the application?

           

          Try moving the assets out into the application storage directory instead.

          • 2. Re: Flex application running under AIR takes a long, long time to start.
            PauloBonza Level 1

            Thanks for the reply. The problem with having the assets in the app-storage folder is that I soon run into the well documented security sandbox issues. The main AIR application loads a swf, which in turn loads many other swf, image and mp3 assets. If I move the swf to app-storage I can still load it into the application sandbox using readBytes and allowLoadBytesCodeExecution, but it then expects all its assets to also be in the application folder, but they aren't - they're still in app-storage.

             

            I still think it's odd that AIR would want to scan my application folder. Surely the update framework just compares the application version strings to decide if it needs to do anything.

             

            So, the question still is, how do I stop AIR taking 90 seconds to scan my application folder. Alternatively, how can I get the dynamically loaded SWF in app-storage to locate it's assets?

            • 3. Re: Flex application running under AIR takes a long, long time to start.
              EgorKDie Level 2

              " still think it's odd that AIR would want to scan my application folder. Surely the update framework just compares the application version strings to decide if it needs to do anything."

               

              You'd think so, but according to Adobe, adding any files into the application directory may mess up the updater when it works out if a new version is required (I think one of the AIR engineers stated that on Flexcoders). The implication being that it checks all the files in the directory...

               

               

              Can you embed all the assets into a swf and load them that way?

              1 person found this helpful
              • 4. Re: Flex application running under AIR takes a long, long time to start.
                PauloBonza Level 1

                Well, I've spent a bit longer looking at this now, and the problem appears to lie with my encrypted local store. The first thing that happens is for the app to read the product key from the ELS. But, it fails (for some unknown reason). So, the app seems to hang there for 90 seconds until it eventually renders the welcome screen. If I remove the assets folder it still fails to read from the ELS, but only takes a couple of seconds to start the welcome screen. This is where the scanning of the application folder seems to come into play, because if I remove the code which reads from the ELS the app starts within 2 seconds whether the asset folder is there or not.

                 

                I think the slow startup and the scanning of the assets folder are just symptoms of a different problem, i.e. a problem with the ELS. I don't have the same problem with my development environment though - it's only when I test deploy the application.

                 

                Thanks for your help on this problem EgorKDie. I think I should be able to resolve it once I can sort out why the ELS is being awkward.

                • 5. Re: Flex application running under AIR takes a long, long time to start.
                  EgorKDie Level 2

                  No problems, just make sure you post the solution to the ELS issue when you find out what the problem is, just so the thread is complete!

                   

                  You've got yourself a doozy there, so good luck!

                  • 6. Re: Flex application running under AIR takes a long, long time to start.
                    evan64568745845674534

                    Did you ever fix this in your app, PauloBonza? I'm running into the same thing.