Hi,
If I test movie in CS3 this code will save a JPG on my desktop…
package
{
import com.adobe.images.*;
import flash.display.*;
import flash.events.*;
import flash.filesystem.*;
import flash.filters.*;
import flash.geom.*;
import flash.text.*;
import flash.utils.*;
import nl.stroep.utils.*;
public class Main extends Sprite
{
public function Main():void
{
var bitmapData:BitmapData = new BitmapData (stage.stageWidth, stage.stageHeight, true, 0x000000 );
bitmapData.draw(this);
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 );
stream.close();
}
}
}
If I compile it as an AIR app and install it, it doesn’t create a file… anywhere…
I don’t understand why it would work when testing but not when it’s compiled…
Any ideas?
Thanks,
Matt.