6 Replies Latest reply on Aug 11, 2008 9:28 AM by screen190

    Air cache

    screen190
      Is there a way to use air for a massive cache of images and scripts for use on external web aplication?

      I mean to build an aplication with several images, audio etc and then redirect to a external page that will use this stuff instead of download from the site.

      I'm trying to build an aplication including folders with stuff and then redirect using javascript to the site, but cant access to the stuff then...
        • 1. Re: Air cache
          anirudhs Level 2
          Hi,

          You won't be able to embed the image / audio data in the external HTML once your external HTML file has access to the filenames / actual binary data.

          Maybe you should re-design your application so that there is a XML file with only the data you want to display. The images / audio / main app is all AIR.

          • 2. Re: Air cache
            screen190 Level 1
            thx for the answer,
            of course i can expend a lot of time rebuilding the application to build an air ready application, but what I only need is to execute the application faster.

            Is an application using extjs and zend framework and for extjs no problem, but rebuild all serverside to work with local html files on air will be a lot of time

            My idea was to simpli store all extjs, tinyMCE, images, etc on local drive instead downloading it any time the users enter via browser.
            I want (if I can) to build an aplication in air as a webbrowser optimized for a concrete site.
            • 3. Re: Air cache
              anirudhs Level 2
              This is the only way I can think of:

              Download the html file from your server using URLLoader (make sure the pages are using relative paths to imgs / audio). Now you can either save it to file or directly set it to HTMLLoader via load() / loadString() respectively. If you have the images and audio in your air app's folder, it will pick them up here.

              The point here is that mixing server side and local content will not be easy. But if you bring all the data from server to client and make AIR believe everything was loaded from AIR's application folder, what you say can be accomplished.
              • 4. Re: Air cache
                screen190 Level 1
                thx anirudhs,

                I' m trying to do that:

                var htmlLoader = new air.HTMLLoader();
                htmlLoader.loadString("<html><body>test string</body></html>");
                //htmlLoader.load(new air.URLRequest("http:\\www.test.com"));

                but no luck, what I'm missing?
                • 5. Re: Air cache
                  anirudhs Level 2
                  Don't create a new HTMLLoader like that. If you want the main window's HTML to change, use window.htmlLoader.loadString("<html><body><p>Boo!</p></body></html>");

                  If you want it to popup in a new window, use var popupHTML = air.HTMLLoader.createRootWindow(); popupHTML.loadString("whatever");
                  • 6. Re: Air cache
                    screen190 Level 1
                    thnx anirudhs
                    now is working as i need!!!
                    great!