I am getting this error Error #2035: URL Not Found. on random images (maybe 50% of the images being loaded) based off of this code:
Actionscript Code:
private function loadExternalTile(imgName:String) {
trace("BEGIN LOAD: " + imgName);
// Add tile upon loading completion;
imageLoader = new Loader();
imageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE,externalTileLoaded);
imageLoader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, IOErrorHandler);
imageLoader.load(new URLRequest(imgName));
}
private function externalTileLoaded(e:Event) {
tileBaseMC.addChild(e.target.content);
}
private function IOErrorHandler(e:IOErrorEvent):void {
trace("the loader threw an error");
trace( e );
}
Here is what the error handler is tracing
Actionscript Code:
[IOErrorEvent type="ioError" bubbles=false cancelable=false eventPhase=2 text="Error #2035: URL Not Found. URL: file:////Volumes/Macintosh%20HD/Users/me/Documents/Flash/Games/mygame/src/Editor/images/tiles/grass01.png"]
If I navigate to the URL that apparently doesn't exist, it loads up just fine, so what gives?
This code is run on a "tile" object when loaded a saved level. Like I said at the beginning, this happens randomly and to about 50% of the tiles being loaded in the level. There are hundreds of these being run at the same time when a level loads. Is that what is breaking it?