-
I'm developing a form that should allow the user to change the details of already existing txt files from flash. I've no problem loading the variables from the text files to the Flash form fields with dynamic text. However, if I want to change any of the variable contents and write them back to the text files, I just don't find any way of doing it without passing by ASP, which I can't do, as the appl is to be run offline.
I'm trying to get to grips with fscommand, exec and dos commands but honestly I haven't got a clue of what I'm doing. The fscommand line should go after
on release {
fscommand("exec", ................)
after which anything I try doesn't affect the text at all.
Has anybody got any suggestions pls?
Thanks a lot.
Ap
-
Lifetime Friend of Site Staff
SWF Studio (www.northcode.com) is a tool that will convert your SWF files to EXE files with some extra functionality. It also comes with some FREE plugins that can help solve your file I/O problems.
The FILESYS plugin (www.northcode.com/studio/plugins/filesys.html) allows you to easily read and write text files using the FILESYS.READFILE and FILESYS.WRITEFILE commands.
The INIFILE plugin (www.northcode.com/studio/plugins/inifile.html) gives you a way to read and write INI files. Adding some structure to your files makes data retrieval much easier.
Check out the SWF Studio support forums at http://www.northcode.com/forums and if you get stuck you can also find me here or at support@northcode.com
-
First of all a 3rd party tool is not required to write .txt files you can used the unsupported Save command..
Here's the best URL I found on the web concerning how to use it..
http://groups.google.com/groups?q=Fs...iveyleague.com
You can also use the command line method.. there was a excellent reference of a how to in a thread on flashkit I recommend you try several search's.. (it's there it may just be a bit buried)
Lastly you can use 3rd party programs (like mine), Northcode's or ***********'s
-
Banned
*********** JTools - JSave
http://jtools.***********.com
Good luck
-
thanks, I'd rather use no third party tools, as it's for my final... I've tried
fs ("save", "file.txt")
and it works, but as u said there's all the variables in the flashfile, whereas I require just some specific ones (form fields).
I've tried the following command lines:
1.
on (release) {
fscommand ("exec", "command.com" add chr(9) add "/c" add chr(9) add "echo" add chr(9) add question add ">c:\\writeFile.txt");
}
2.
on (release) {
fscommand ("exec, "command.com" add chr(9) add "/c" chr(9) add "echo" add chr(9) add question add ">>writeFile.txt");
}
but I get a (syntax) error message on playing/publishing and nothing more.
Any other suggestions ?
TA
-
Lifetime Friend of Site Staff
Check out http://www.ci-berpages.com/flash/flash.htm for info on how to write data to a text file from Flash. You'll find working examples of how to do it with just Flash. But you should know that there are caveats with using the command.com approach too.
Les also has some new freeware tools that allow you to do this. If you don't want to use a third party tool (free or not), you're going to do a lot more work than you have to.
-
Thanx, I've tried the w/s and it works to a certain point. the problem that still remains is -- I can I write a string with separators to a txt file?
If I go back to coding, this is what I've done:
on (release) {
textVar = "question=" add question add "&a1=" add a1 add "&a2=" add a2 add "&a3=" add a3 add "&ca=" add ca add "&category=" add category add "&level=" add level;
gotoAndPlay ("edit2");
txtVar2 = "";
len = textVar.length;
for (x=0; x<len; x++) {
space = textVar.substring(x, x+1);
if (space == chr(32)) {
txtVar2 = txtVar2 add "|";
} else {
txtVar2 = txtVar2 add space;
}
}
trace (txtVar2);
fscommand ("exec", "command.com" add chr(9) add "/c" add chr(9) add "echo" add chr(9) add txtVar2 add ">C:\\writeFile.txt");
}
The "|" char is added at the end of each word and appears in the swf file, but when it comes to writing the string to the txt file, its content is actually erased. Unless the string has no spaces in between and doesn't need parsing.
Please help, I'm really going round the bend with this.
Thanks
Apt966
-
Lifetime Friend of Site Staff
The "|" has a special meaning to the DOS command line. It's called a "pipe" and it's used for sending the output of a process to another process. You can't use it.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|