I've been able to load a webpage from within my application using code such as the following:
var loader:HTMLLoader = new HTMLLoader();
var url:URLRequest = new URLRequest("http://...");
url.useCache = false;
Let's say a user clicks a link inside the window to load a new page. Some questions:
1) Will useCache variable affect any page the user loads inside the window after the initial load?
2) Is there any way to set a cache expiration time? Alternatively, is there any way to flush the cache? I noticed there's a reload() command in Air, but would that effect individual pages the user navigates to after the main page?
3) Is there a notification that the Air application gets when the user navigates the entire window to a new page?
4) Is there any way to send a message to the Air application inside an HTML page? For example, the user clicks an HTML close button embedded in the web page, causing the Air application to close the entire window.
AIR does not implement application level caching, useCache flag is forwarded to the native networking stack. This means that it will use whatever OS-specific URL caching available. Expiration policy is also OS dependent.
Setting useCache on HTMLLoader propagates to all the requests made from within that HTMLLoader. So it will affect any page, not just the initial page.
Unfortunately, there's no notification send when HTMLLoader loads additional resources (inlcuding when the main page is changed).
There are mechanisms for the page loaded by HTMLLoader to communicate wiht the AIR app. If the HTML is in the application sandbox, it can use the AIR APIs directly, through what is called bridging. For details see http://help.adobe.com/en_US/air/html/dev/WS5b3ccc516d4fbf351e63e3d118666ade46-7f0d.html
If the HTML content is in remote sandbox, you can use the parent sandbox bridge, as explained in http://help.adobe.com/en_US/air/html/dev/WS5b3ccc516d4fbf351e63e3d118666ade46-7f0d.html