filereference - Flex: Read bytearray -


I use the following to upload files to Flex:

  private var Filer: FileReference; Protected function button 1_clicker (event: mouseevant): zero {var fd: string = "files (*)"; Var fe: string = "*"; Var FF: filefilter = new file filter (FD, FF); Filer = New FileReference (); Filer.addEventListener (Event Selection, onFileSelect); Filer.browse (new array (FF)); Filer.addEventListener (event.complete, function (e: event): zero {e.currentTarget.data.toString ();}); } Select File on Private Function (E: Event): Zero {filer.load (); }  

And my file looks like this: alt text

Here is the original file:

I need to read and paste the uploaded file. The problem is that in my e.currentTarget.data.toString (); I only get ' 1 and not the remaining string.

Any ideas on how to successfully read this entire TCTF file?

This property is a toString method (which apparently ends the string Instead of using zeros byte), use specific reading methods of byte class such as readByte , readInt etc.

  var array: array = []; Var ba: Bytere = e.currentTarget.data as byte array; While (Bybytes available! = 0) {Sir. Peash (Ba. Robet ()); } Trace (array.join (","));  

You may want to read


Comments