I am trying to load my png file to my application. here is the code
var map:mapLoader = new mapLoader();
map.loadMap("tile.png");
Then here is my file that loads it. it throws the error right when it gets to
loader.load(new URLRequest(currentMap));
if I comment it out. then the error goes away. below is the code in its entirety
package {
import flash.display.Loader;
import flash.net.URLRequest;
import flash.net.*;
import flash.events.*;
import flash.display.BitmapData;
import flash.display.Bitmap;
import flash.display.Sprite;
public class mapLoader extends Sprite{
private var currentMap:String;
private var loader:Loader;
private var xmlLoader:URLLoader;
private var worldRows:Number = 100;
private var worldCols:Number = 100;
public var world:Array;
public var mapTile:BitmapData;
public var arry:Array = new Array();
public function mapLoader():void
{
// the output window width and height in pixels
worldCols=100;
worldRows=100;
world = new Array();
}
public function loadMap(mapName:String = "empty"):void
{
currentMap = mapName;
if(currentMap != "empty")
{
//load in tile sheet image
loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.INIT,tilesLoadInit);
loader.load(new URLRequest(currentMap));
}
}//End MapLoader
private function tilesLoadInit (e:Event):void {
mapTile = Bitmap(loader.content).bitmapData;
}
}
}
I am getting the following error
Error #2044: Unhandled IOErrorEvent:. text=Error #2035: URL Not Found.