Quantcast
Channel: Adobe Community : Popular Discussions - Archived Discussions
Viewing all articles
Browse latest Browse all 21156

write and read a text file

$
0
0

Hi I'm using Flash Cs5 exporting to Air 2

 

I can write a text file, but am struggling to read in back in. Here is my code so far. Any help would be greatly appreciated

 

import flash.filesystem.File;

import flash.filesystem.FileMode;

import flash.filesystem.FileStream;

 

 

var settingmike="mike57"

var filef:File = File.documentsDirectory.resolvePath("settings6.txt");

var streamf:FileStream = new FileStream();

streamf.open( filef, FileMode.WRITE );

streamf.writeUTFBytes(settingmike);

streamf.close();

filef = null;

streamf = null;

 

 

var fileff:File = File.documentsDirectory.resolvePath("settings6.txt");

var streamff:FileStream = new FileStream();

streamff.open( fileff, FileMode.READ);

streamff.readUTFBytes(settingmike);

//I want to see it in a text field called my_textfield

//my_textfield.text=streamff

 

thanks

 

 

KBN


Viewing all articles
Browse latest Browse all 21156

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>