var fs:FileStream = new FileStream();
fs.open(,FileMode.READ);
var string:String = fs.readMultiByte(fs.bytesAvailable, "UTF-32");
Showing posts with label air. Show all posts
Showing posts with label air. Show all posts
Wednesday, September 14, 2011
Adobe Air: Problem while reading „ and “
Solution: use UTF-32 encoding
Sunday, September 11, 2011
Air: change / specify runtime location of air application [way to run air application in machine with out runtime installation]
Only way is to use adl.exe while running your applicaiton. With normal installer you cannot do so. So idea is to 1)use a bat file to manually specify your applicaiton.xml location and adobe run time location.
2) If you do'nt like console then wire a program for you own that does what bat file does but with out console visible. I have written such program in c++. If you need it just leave a comment .
2) If you do'nt like console then wire a program for you own that does what bat file does but with out console visible. I have written such program in c++. If you need it just leave a comment .
Friday, September 9, 2011
adobe air :: File handling
- The static properties included in File class :
File.applicationDirectory Directory where the application is installed and it is read only
File.desktopDirectory Desktop directory of the User
File.documentsDirectory Documents directory of the user
File.userDirectory User Directory
- saving file:
- var bytearray:ByteArray = new ByteArray();
- var fileToCopy:File = new File("url of file");
- var newFile:File = new File("url of file to be created");
- var fileStream:FileStream = new FileStream();
- fileStream.open(file,FileMode.READ);
- fileStream.readBytes(bytearray);//getting bytes
- var newFileStream :FileStream = new FileStream()
- newFileStream.openAsync( newFile, FileMode.WRITE );
- newFileStream.writeBytes(bytearray);//filling bytes
- newFileStream.close();
- Updating file
public function update(value:String,url:String,startIndex:int = 0):void
{
var file:File = new File(url);
var fs:FileStream = new FileStream();
fs.open(file,FileMode.UPDATE);
fs.position = startIndex;
fs.writeUTFBytes(value);
fs.close();
}
{
var file:File = new File(url);
var fs:FileStream = new FileStream();
fs.open(file,FileMode.UPDATE);
fs.position = startIndex;
fs.writeUTFBytes(value);
fs.close();
}
- Getting current directory in air:
- NativeApplication.nativeApplication.addEventListener(InvokeEvent.INVOKE, onInvokeEvent);
- public function onInvokeEvent(invocation:InvokeEvent):void {
- var currentDir:File = invocation.currentDirectory;
- }
- File systems's tutorial:
- Draggout out gesture [Dragging file from air to filesystem]
- Uploading file in air
Subscribe to:
Posts (Atom)