PDA

View Full Version : Problem with loading remote image from local swf


Alvin
01-20-2006, 02:44 PM
Hi,

I have the following code to load an image file(jpg) from remote server to a local swf. But it just says "Error opening URL".

var swf:MovieClip = _root.createEmptyMovieClip("swf", _root.getNextHighestDepth());
var loader:MovieClipLoader = new MovieClipLoader();
var obj:Object = {};
obj.onLoadInit = function(target_mc:MovieClip) {
trace("onLoadinit");
};
loader.addListener(obj);
loader.loadClip("http://192.168.1.2/image/image02.jpg", swf);
trace(System.security.sandboxType);

I think it's a security issue. But the result of trace(System.security.sandboxType) is localTrusted. According to the Flash Player 8 Security document, "SWF files assigned to the local-trusted sandbox can interact with any other SWF files, and load data from anywhere (remote or local).".
I have tried this image URL in the browser and it's OK.
Now I am confused. Do you guys have any suggestions?
Any help will be appreciated.:)