i am using this function:
// use adobe’s encoder to create a byteArray
var jpgEncoder:JPGEncoder = new JPGEncoder( 100 );
var byteArray:ByteArray = jpgEncoder.encode( bitmapData );
// set an filename
var filename:String = prefixFileName+"_" +i+".jpg";
// get current path
var file:File = File.applicationDirectory.resolvePath( filename );
// get the native path
var wr:File = new File( file.nativePath );
// create filestream
var stream:FileStream = new FileStream();
// open/create the file, set the filemode to write in order to save.
stream.open( wr , FileMode.WRITE);
// write your byteArray into the file.
stream.writeBytes ( byteArray, 0, byteArray.length );
// close the file.
and it seems to work great in Windows XP (get stuck for 20 sec and save the pictures on file system),
but in Windows 7 it get stuck and thats it!! nothing saved, nothing released, i get the stuck screen and need to close the program,
any ideas what need to be done in Windows 7?
i found the issue:
File.applicationDirectory doesn't work on Windows 7, i used the user directory path and it works.
You should not use applicationDirectory to save files.