Next, the bootloader class is used, but it is synchronous.
var loader:Loader = new Loader(); loader.loadBytes(byteArray); bmpData.draw(loader);
Change Never forget that loadBytes is also asynchronous, the documentation says you need to wait for the init event. What is the reason for the unwillingness of event listeners? This is a fairly common practice in AS3.
So you need something like this:
var loader:Loader = new Loader(); loader.contentLoaderInfo.addEventListener(Event.INIT, function(e:Event):void { bmpData.draw(loader); }); loader.loadBytes(byteArray);
source share