Found the answer myself. Move the files somewhere other than the default application directory. I put them in the app-storage directory and then link to there using the app-storage:/ instead of app:/
Works great. No access to api anymore, but that's ok.
Use to specify a path relative to the root of the file system. For example:
The URL standard specifies that a file URL takes the form file://<host>/<path>. As a special case,<host> can be the empty string, which is interpreted as "the machine from which the URL is being interpreted." For this reason, file URLs often have three slashes (///).
Use to specify a path relative to the root directory of the installed application (the directory that contains the application.xml file for the installed application). For example, the following path points to an images subdirectory of the directory of the installed application:
Use to specify a path relative to the application store directory. For each installed application, AIR defines a unique application store directory, which is a useful place to store data specific to that application. For example, the following path points to a prefs.xml file in a settings subdirectory of the application store directory:
1 person found this helpful
There's also the iframe technique described here: http://help.adobe.com/en_US/air/html/dev/WS5b3ccc516d4fbf351e63e3d118666ade46-7f08.html#WS 5b3ccc516d4fbf351e63e3d118666ade46-7f07, which doesn't require moving files.
1 person found this helpful
They only load into a non-app sandbox if you set the sandboxroot and document root properties of the iframe. (These aren't standard iframe properties, of course, we added them for this purpose).
So far I've not been successful getting the iframe technique to work. Perhaps it's my sandboxRoot and documentRoot settings. Not sure. Still getting the same results as having the files in the app sandbox.
documentRoot="http://localhost/" / >
No luck with those settings either.
The technique was in fact working. My datasets just were not loading, but that's an unrelated problem. I'm guessing it's a cookie problem with the different sandboxes. Will figure that out on my own. Thanks again.
The new problem that arises is that XHR requests to anything other than http://locahost are blocked. I guess I'll move back to my original technique of loading the files from outside of the application directory. That way the files are free from cross domain xhr blocks and able to communicate with external data sources.
Error: SECURITY_ERR: DOM Exception 18
Found a solution. Resolve the file:/// path of the application directory and point the iframe there. Have not experimented if a sandbox bridge would work this way or not. Thanks for your help.
var dir = air.File.applicationDirectory;
var file = dir.resolvePath("index.html");
var path = 'file:///'+file.nativePath;
var iframe = "<iframe src='"+path+"' id='iframe' name='myiframe' sandboxRoot='http://localhost/' documentRoot='app:/' width='100%' height='100' frameborder='0'></iframe>";