|
|||
|
I want to update a text file located in the same folder as my project.
The path to the file is relative, e.g. "/xml/myfile.xml" But I suppose that a relative path does not work with FileStream(fn, data) ... so how to convert the relative path to an absolute one? This is what I'll have already: var fn = FlashPlayer.getVariable("_level0.fn") var data = FlashPlayer.getVariable("_level0.data") trace(fn) //this returns "/xml/settings.xml" //so here we need a conversion from relative to absolute path, right? :-\ var file_stream = new FileStream(fn,"w"); file_stream.write(data); tnx, Gert |
|
|||
|
hm, I did find the answer myselve ...
this was the command I was looking for: getAppDir(); so here's the working code: var path = getAppDir(); var fn = FlashPlayer.getVariable("_level0.SwfKit.updateFile .fn") var data = FlashPlayer.getVariable("_level0.SwfKit.updateFile .data") trace(data) trace(path + fn) var file_stream = new FileStream(path + fn, "w"); file_stream.write(data); |
![]() |
Was this information helpful? Yes No
| Thread Tools | |
| Display Modes | |
|
|