I’m trying to use a loader to populate the images in a Sky Box, so instead of using:
[Embed(source="assets/room1/right.jpg")]
public static var room1_EnvPosX2:Class;
skyBoxCubeMap = new BitmapCubeTexture(room1_EnvPosX2().bitmapData, etc etc etc);
I’m trying to use something like:
var my_loader:Loader = new Loader();
my_loader.load(new URLRequest("../src/assets/room1/right.jpg"));
my_loader.contentLoaderInfo.addEventListener(Event.COMPLETE, startListener);
function startListener(e:Event):void
{
var mybitmapData:BitmapData;
mybitmapData = Bitmap(LoaderInfo(e.target).content).bitmapData;
skyBoxCubeMap = new BitmapCubeTexture(mybitmapData, etc etc etc
}
When I do that it throws a null object error on line 130 of BitmapCubeTexture.as
Any suggestions gratefully received!
Simon