android - updating multiple text file at once -


i'm creating app using flash cc. need create couple of text files save data. can create , save data text file can update 1 file @ time. i've used following code:

for(var i:int = 1; <= 5; i++)     {         var file:file;         file = file.documentsdirectory.resolvepath("myapp/" + this["folder" + i] + "/playinfo.txt");          var stream:filestream = new filestream();         stream.open(file, filemode.write);         stream.writeutfbytes("something");         stream.close();     } 

the above code seems edit last file. doing wrong ? appreciated. i'm thinking of using timer instead of for-loop update single text file @ time.which approach better ? or there better solution achieve ?

i'm not sure object this in context of (this["folder" + i]), removing this reference , using folder + i result in:

myapp ├── folder1 │   └── playinfo.txt ├── folder2 │   └── playinfo.txt ├── folder3 │   └── playinfo.txt ├── folder4 │   └── playinfo.txt └── folder5     └── playinfo.txt 

so code snippet becomes:

    for(var i:int = 1; <= 5; i++)     {         var file:file;         file = file.documentsdirectory.resolvepath("myapp/" + "folder" + + "/playinfo.txt");         trace(file.tostring());         var stream:filestream = new filestream();         stream.open(file, filemode.write);         stream.writeutfbytes("something");         stream.close();     } 

Comments

Popular posts from this blog

android - Why am I getting the message 'Youractivity.java is not an activity subclass or alias' -

python - How do I create a list index that loops through integers in another list -

c# - “System.Security.Cryptography.CryptographicException: Keyset does not exist” when reading private key from remote machine -