Flex笔记之读写到txt文本中去。

private function readTxt():void { var file:File = File.desktopDirectory; var txtfilter:FileFilter = new FileFilter("Text","*.as;*.css;*.txt;*.java;*.html;*.htm;*.xml"); file.browseForOpen("Open",[txtfilter]); file.addEventListener(Event.SELECT,function(e:Event):void{ var file:File = new File(e.target.nativePath); var filestream:FileStream = new FileStream; filestream.open(file,FileMode.READ); var bytes:ByteArray = new ByteArray; filestream.readBytes(bytes,0,file.size); var name:String = transEncodingText(bytes); var arr:Array = name.split("/r"); if(arr!=null && arr.length>0){ for(var i:int=0;i

你可能感兴趣的:(flex,hashmap,file,string,function,object)