Quantcast
Viewing all articles
Browse latest Browse all 21156

loading local swf into a remote sandbox using mx:html control

Hi,

 

I have a swf which expects to run in a remote sandbox, ie is normally loaded from http://mydomain/test.swf. It will then access files from the location it was loaded. So this works fine if I load the swf using the browser.

Now my air application caches this swf and all its required files to a folder under the app-storage folder. My goal is to load this swf from within my air application. I can't use the normal swfloader as this will use the application sandbox and I get security errors when the loaded swf tries to access files. My next attempt was to try and create a remote sandbox using a mx:html control.

 

var file:File = templateFolder.resolvePath("loader.html");
var request:URLRequest = new URLRequest(file.url);
_iHtml.htmlLoader.load(request);

 

loader.html contains:

<html>
  <body>
    <iframe id="UI" src="http://www.xyz.com/air/test.html" sandboxRoot="http://www.xyz.com/air/"
     documentRoot="app-storage:/template/"
     style="background-color: #ffe; width:100%; height:100%">
    </iframe>
  </body>
</html>

 

(xyz being replaced with a real domain) (test.html just contains simple text as a test)

 

My logic here is that the file test.html will be mapped to the documentRoot folder and loaded. This does not happen and I get a not found url message from the domain server.

Questions:

Can I use the sandboxRoot/documentRoot attributes with the mx:html control?

If these are valid then what am I doing wrong.

 

Many thanks,

 

John


Viewing all articles
Browse latest Browse all 21156

Trending Articles