0

I need to import a BMP file to the stage, i tried with URLLoader and with filestream, but i can't, there is a way to do this?

This is what i tried, with jpg it works:

var loader:Loader = new Loader();
loader.load(new URLRequest("foto.bmp"));
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onCompleteHandler);

function onCompleteHandler(event:Event):void 
{
  event.target.removeEventListener(Event.COMPLETE, onCompleteHandler);
  addChild(event.target.content);
}
goncy
  • 95
  • 1
  • 7
  • Does the handler not get called (ie is an event dispatched) or is the DisplayObject empty? – MickMalone1983 Aug 11 '14 at 21:44
  • 2
    Flash Player doesn't support Bitmaps out of the box (just jpg, gif, png, swf) - you can load in binary data and process it - a lot of work but there are libraries out there already made: http://stackoverflow.com/questions/2106195/loading-bmp-and-tiff-file-in-flash-10-using-loader – BadFeelingAboutThis Aug 11 '14 at 21:45
  • I've flagged this as a duplicate of the link in my comment above. The solution in the two links on that question is what you need. – BadFeelingAboutThis Aug 11 '14 at 21:52

0 Answers0