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

sql - VB.NET Operand type clash: date is incompatible with int error -

SVG stroke-linecap doesn't work for circles in Firefox? -

python - TypeError: Scalar value for argument 'color' is not numeric in openCV -