3 Replies Latest reply on Jul 31, 2008 10:46 AM by mjr81

    Use AIR with website to call HTML into Flash

    year2010
      Hi,
      I'm a .NET programmer and thus new to the world of Flash and AIR. I'm creating a flashsite and want to call an external html or URL into my flashsite. I search online and found out that swf can only call another swf, image, xml, or text file. One cannot call a HTML into a SWF. But, someone suggested AIR. Can I use AIR to call an external URL or HTML into a SWF? Also, I kept reading about AIR creates desktop applications, but can it be use to create or implement websites?

      Thank you.
        • 1. Re: Use AIR with website to call HTML into Flash
          Joe ... Ward Level 4
          It is true that AIR includes a complete web engine (webkit), but it is also true that the AIR apis can only be used in desktop applications -- the code is not available in the Flash Player plugin that runs in the browser.

          Note that the Flash TextField control will render simple HTML-formatted text.
          • 2. Re: Use AIR with website to call HTML into Flash
            year2010 Level 1
            So to clarify. Using AIR, I can call HTML website into a SWF because AIR has a "webkit". But AIR applications can only be run on a desktop environment not on the internet web browser.

            Please confirm. Thank you.
            • 3. Re: Use AIR with website to call HTML into Flash
              mjr81
              I think there's a fundamental mis-understanding of AIR's capabilities here.

              You can build an AIR application one of two ways right now:
              Flash/SWF based.
              HTML/JS/CSS based.

              You need to choose a method and go with it because they're inherently different.

              Developing in Flash for AIR is a lot like developing flash for the web except that you get other classes that let you interact with the filesystem and local encrypted stores, etc. Same with HTML. You get javascript hooks that let you interact with the operating system.

              Flash can display simple HTML and render it correctly, but good luck calling a URLRequest on a website and expect the HTML to render correctly in a flash wrapper. It's most likely not going to happen. You're better off to put things in simple text files of xml and have flash parse and format the information.

              Otherwise, you can use HTML and JS to make AJAX requests and pull in entire sites because you have the webkit rendering engine available to you in the HTML form of an AIR application. You have everything a website could do including iframes and dynamically updated DOM elements via javascript calls.

              To further answer your question, AIR application can only be run on the desktop but can take advantage of internet connectivity to function correctly.

              If you want to develop Flash for the web, don't use AIR... it'll be doomed to fail. If you want a desktop executable, multi-platform solution, AIR is what you're looking for.

              I hope I answered your questions and clarified a bit more.