3 Replies Latest reply on Nov 1, 2010 2:55 PM by CoreyRLucier

    Invalid bitmap data from drawing

    bryant_16 Level 1

      Hey guys, this is my codes:

       

      private function loaderComplete(event:Event):void

      {

      graphics.clear();

      var loaderInfo:LoaderInfo = LoaderInfo(event.target);

      bitmapData = new BitmapData(loaderInfo.width, loaderInfo.height);

      bitmapData.draw(loaderInfo.loader);

      graphics.beginFill(data.color);

      graphics.beginBitmapFill(bitmapData);

      graphics.drawRect(0,0,loaderInfo.loader.width,loaderInfo.loader.height);

      graphics.endFill();

      }

       

      And I encounter this error: ArgumentError: Error #2015: Invalid BitmapData.

       

      Is there anything I miss out or something like that?