Im using the bulkloader library on AIR to download an image, then using the AS3corelib im trying to save the file locally using:
var byteArray:ByteArray = jpgEncoder.encode( loader.getContent("IMG_0004.JPG") );
stream.writeBytes(byteArray);
stream.close();
But im getting this error:
TypeError: Error #1034: Type Coercion failed: cannot convert flash.display::Bitmap@8349a81 to flash.utils.ByteArray.
I have no idea how to solve this.