Posted by TodayRatha in
on
-
import flash.net.FileReference;
public function LocalFileAccessExample():void {
var fileRef = new FileReference();
fileRef.addEventListener( Event.SELECT, onFileSelect );
fileRef.addEventListener( Event.OPEN, onFileOpen );
fileRef.browse();
}
private function onFileSelect( event:Event ):void {
var fileRef:FileReference = event.target as FileReference;
fileRef.open();
}
//--------------------- option with filter
var imagesFilter:FileFilter = new FileFilter("Images",
"*.jpg;*.gif;*.png");
var docFilter:FileFilter = new FileFilter("Documents",
"*.pdf;*.doc;*.txt");
var myFileReference:FileReference = new FileReference();
myFileReference.browse([imagesFilter, docFilter]);
private function onFileOpen( event:Event ):void {
var fileRef:FileReference = event.target as FileReference;
var data:ByteArray = fileRef.data as ByteArray;
}
Category List
- Actionscript 3 (2)
- Digital Painting (1)
- Life style (1)
- Photoshop (1)
- Sencha Touch (1)
Blog Archive
-
▼
2010
(50)
-
▼
March
(12)
- Mootool | Native Array Sum Value in Elements
- Identify Font
- AS3 | Call Javascript Function
- AS3 | Stage no scale
- Flash AS3 | Why buttonMode not working
- AS3 Convert MovieClip or Display to BitmapData
- AS3 | Crop image
- Flash AS3 | Proportion Width and ScaleX
- Wamp & Another Package PHP | Virtual Host
- PHP | Config with Apache 2.2
- Flash AS3 | Open local Image
- Flash AS3 | Remove all child from display object
-
▼
March
(12)