Having problem to load external image in gif player.
I am using as3gif class package
This is working :
import flash.display.Sprite;
import flash.net.URLRequest;
import org.gif.player.GIFPlayer;
var request:URLRequest = new URLRequest("diego.gif");
var player:GIFPlayer = new GIFPlayer();
player.load(request);
addChild(player);
and This is not working :
import flash.display.Sprite;
import flash.net.URLRequest;
import org.gif.player.GIFPlayer;
var request:URLRequest = new URLRequest("http://www.idea-files.com/problemGif/127.gif");
var player:GIFPlayer = new GIFPlayer();
player.load(request);
addChild(player);
When I test in my flash CS5 it loaded image. But on server not load the image Can you give me any advice ?
If you have access to the remote domain, you can deploy a crossdomain.xml file there. That is a file that Flash Player looks for to see if that domain is allowing Flash apps from other sites to access it's data. Generally for JPEG and PNG images this isn't necessary, unless you want to actually access the bitmap data that those images contain.
By default Flash doesn't display GIF's (or maybe just animated GIF's), and that library you're using is likely getting at the bitmap data to make the animation. Hence, in this scenario you can think about doing one of the following:
Deploy a crossdomain.xml on that server. I'll omit the steps to do this, as it's well documented by Adobe.
If you don't control that server you should contact that site and ask them if they will allow you to download the image so you can deploy it on your own server or embed it in your SWF. Or ask if they can deploy a crossdomain.xml file for you.
Create your own animation in Flash Professional, this removes the need for the GIF library.
Create your own animated GIF.