image path on mobile - AIR
I want to create image on my mobile application, after that i want to export the image. this is my code i got from other tutorial post. im using adobe flash and export it as AIR for android.
var jpgEncoder:JPGEncoder = new JPGEncoder(90);
var byteArray:ByteArray = jpgEncoder.encode( bitmapData );
// set an filename
var filename:String = "cool-wallpaper.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; because we are going to save
stream.open( wr , FileMode.WRITE);
// write your byteArray into the file.
stream.writeBytes ( byteArray, 0, byteArray.length );
// close the file. That’s it.
stream.close();
on my computer, the image appear on the same link as my source application. but its not working on mobile.
i tried this using android, my application is working but the image is not appear (i can't found it on any folder in my android phone).
i think i should change the path on: var filename:String = "cool-wallpaper.jpg";
but don't know what is the right path..
any one can help me about this image path issue?
