2 Replies Latest reply on Feb 8, 2010 1:28 PM by tzeng

    Window 7 stuck after trying to save jpeg to file system

    boliz

      Hi,

      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.
                          stream.close();

      ...

       

      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?

       

      Thanks,

      Boaz