0 Replies Latest reply on Aug 14, 2011 3:18 PM by theMikeD

    Can I reference files in AIR-embedded HTML without creating objects for them?


      Hi there,


      I am just getting into AIR development, and I have a few very basic questions. But to get to the questions, I have to explain why I'm after the answers.


      At the moment I have a system to display photographs in a web browser. It uses HTML and JS to do so, but I'm after a faster solution that I can use a keyboard to navigate. So, enter Air.


      So right now, I have a set of HTML files that all reference photos in various folders...it's complicated, but it's all generated with a perl script so I don't have to do any of it manually. All the links are relative to the HTML file being opened.


      What I'm after is to be able to include the HTML, CSS and JS files in the AIR app, but leave the large number of large image files out of it. IOW I'd like to reference the JPG files from the AIR app, but not include them.


      Now I see that there are things like File.documentsDirectory that will allow me to store and reference stuff like photos, which is great. But how do I tell the HTML files compiled into the AIR app where they are? Must I create a file object for every one of the thousands of images I want to show? Or can I "pre-load" the HTML files that make up the AIR app with the correct AIR file references as static URL references (which would be ideal)?


      So instead of


      <img src="path/to/photo1.jpg" >


      I use


      <img src="something AIR understands" >



      Possible? Or is there a better way? All help appreciated.