I'm building a Flass Application for Facebook, and I'm trying to load some user images from facebook, with their url (they're given to me through flashvars from a php)... The problem is that, while I'm testing it inside Flash, it works like a charm, but when I upload it to the FTP server, it stops working...
I have this on the Stage intialization:
flashvars = this.loaderInfo.parameters;
// constructor code
if (flashvars.imgUrl != null)
{
imgUrl = flashvars.uid;
}
else {
imgUrl = 'https://fbcdn-sphotos-d-a.akamaihd.net/hphotos-ak-frc3/1240107_10201576612713442_1154772803_n.jpg';
//imgUrl = 'imagen_test.jpg';
}
loadImg(imgUrl);
And this further down, on my function definitions...
public function loadImg(str:String):void {
var loader:Loader = new Loader();
var urlReq:URLRequest = new URLRequest(str);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE,_cargaFoto);
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR,_loadError);
Security.loadPolicyFile("http://profile.ak.fbcdn.net/crossdomain.xml");
loader.load(urlReq);
}
public function _loadError(e:IOErrorEvent) {
ExternalInterface.call('console.log',e.type);
}
public function _cargaFoto(e:Event) {
ExternalInterface.call('console.log','it loaded just fine');
miBm = e.target.content;
trace(miBm.width);
bmWidth = miBm.width;
bmHeight = miBm.height;
//addChild(miBm);
getContext(Context3DRenderMode.AUTO); // this starts other part of the code...
}
I'm not getting any IO_ERRORS either, so I don't actually know what's going on.. can anybody give me a hand over here? Thanks a lot in advance!
** EDIT **
The image seems to be loading, it triggers the event that logs 'it loaded just fine', but when I try to use it (I even tried with an addChild of the Bitmap) it won't work.
Any suggestions, please?