Loader:NaN.jpg + SecurityError: Error #2000: No active security context.
hi.
Using the code below, i am getting Error #2035, informing me that my jpg is not a number.
Same code with the ioErrorHandler bits comments, outputs SecurityError: Error #2000: No active security context.
Same code without the randomNumber and with the proper path to the jpgs in the string, works fine (loads 16.jpg), as such - var req:URLRequest = new URLRequest("../images/16.jpg");
Any ideas?
import flash.display.*;
import flash.net.URLRequest;
import flash.display.Loader;
import flash.events.*;
import flash.utils.setTimeout;
var req:URLRequest = new URLRequest("../images/"+randomNumber+".jpg");
var loader:Loader = new Loader();
var randomNumber:Number = Math.ceil(Math.random()*16);
function imageLoaded(event:Event):void
{
addChild(loader);
}
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, imageLoaded);
loader.load(req);
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
function ioErrorHandler(e:IOErrorEvent):void{
trace(e.text);
}
