I think I might need a preloader as I load in tilesets. My problem is that I have no idea how to do this. The examples I have seen so far preload swf files.
I don’t think that that is what I need as I don’t see how that preloads all png files that my game uses, for example this class:
package nl.obg.www {
import flash.display.Loader;
import flash.display.Sprite;
import flash.net.URLRequest;
public class Flag extends Sprite {
private var tileSize:uint;
public var tx:int;
public var ty:int;
private var _loader:Loader;
public function Flag(nwX:int, nwY:int, nwZ:int){
x = nwX;
y = nwY;
z = nwZ;
_loader = new Loader();
addChild(_loader);
_loader.load(new URLRequest("../images/flag.png"));
}
public function init():void {
tileSize = (parent as Map).getTileSize();
tx = x;
ty = y;
x = x*tileSize;
y = y*tileSize;
}
}
}
How would one preload this png and others?