Reputation: 32301
I am working on a project where I need to load a remote swf file into another using flash and as2. This should be simple, but the remote swf file is modular by design (i.e it needs to make calls to load other swf files into it)
When I enter in the location to the remote swf file from a web browser it has no problem loading up.
When I try and load the swf file using flash I get errors relating to the file system. It seems the flash being loaded into my flash is trying to load its other pieces and is looking for them on my computer.
notice the relative ../common/interface_engine.swf reference
*** Security Sandbox Violation ***
Connection to ../common/interface_engine.swf halted - not permitted from http://www.remote-domain.com
-- Remote SWFs may not access local files.
How come a web browser does not have any issue loading swf's like this? I don't get the difference in loading techniques that flash uses and a web browser uses.
Code that I use to load remote file
_root.createEmptyMovieClip("container", 1);
loadMovie(gamePath, "container");
Upvotes: 0
Views: 883
Reputation: 4386
For security reasons, Flash doesn't allow files running locally to have access to both local resources and remote resources. You can have one or the other. When the swf you're loading is referring to "../common/blah", it's relative to where it's being loaded.
Here's a much more in depth article about Flash security: http://www.senocular.com/flash/tutorials/contentdomains/
Upvotes: 1