This content has been marked as final. Show 3 replies
I have the same problem (dynamic image working in flex but not in air)
did you find any solution yet
I am also having an issue that is fine when testing in Flash but stops working when compiled and installed as an AIR app.
This saves an image to the desktop..... but does nothing in AIR.
public function Main():void
var bitmapData:BitmapData = new BitmapData (stage.stageWidth, stage.stageHeight, true, 0x000000 );
var jpgEncoder:JPGEncoder = new JPGEncoder( 100 );
var byteArray:ByteArray = jpgEncoder.encode( bitmapData );
var filename:String = "IMAGE.jpg";
var file:File = File.desktopDirectory.resolvePath( filename );
var wr:File = new File( file.nativePath );
var stream:FileStream = new FileStream();
stream.open( wr , FileMode.WRITE);
stream.writeBytes ( byteArray, 0, byteArray.length );
JPGEncoder should be JPEGEncoder.
Otherwise, your code works fine.