1 Reply Latest reply on May 13, 2011 9:42 AM by Lee Burrows

    Dynamic Image Creation Height/Width Zero

    broconne Level 1

      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.