I load a new image using the following method:
I embed the image with:
private var cubeImage:Class;
Then later in the code, I initailize a new BitmapImage and set the source.
var cube:BitmapImage = new BitmapImage();
cube.visible = false;
cube.scaleX = .5;
cube.scaleY = .5;
cube.visible = true;
I want to modify the x and y locations of the image based in part, on the width and height of the image I am loading. However, the width and height all return zero. I am assuming this is because the image hasn't finished "loading" yet?? Is there a listenting I can use to be notified when the image is ready for manipulation? I could not find one.
cant remember off top of my head which one works, but its one of these:
cube.source = (new cubeImage() as Bitmap).bitmapData;
cube.source = new cubeImage() as BitmapData;