1 Reply Latest reply on Aug 27, 2007 9:03 AM by buabco

    Loader to Bitmap

    Exalto
      Hey.

      How can I load an dynamic image from url and get its bitmapdata?

      I have tried like this but doesn't work..


      var url:String = "assets/test.png";
      var loader:Loader = new Loader();
      var request:URLRequest = new URLRequest(url);
      loader.load(request);
      var image:Bitmap = Bitmap(loader.content);
      var bitmapData:BitmapData = image.bitmapData;
        • 1. Re: Loader to Bitmap
          buabco Level 1
          Exalto,

          For some unexplainable security reason you can't get any bitmap data from images that are not part of your own sandbox, this is your own domain.

          What I've used and worked fine is:

          var bmp:BitmapData = new BirmapData(img.width, img.height);
          bmp.draw(im);