Daten auf Festplatte...

M

Mr.Mista

Ney Ney...

Ich will des Spiel erst mal nich auf nen Server sondern auf die Festplatte hauen.Also muss ich die Textdatei auch erst mal auf der Festplatte speichern.Mit Welcher Sprache geht des?

PS:bidde bidde laaaangsssaaaaam erklären.Mach erst seit kurzem Actionscript und so...

THX im voraus

Mr.Mista
 
langsam geht grad nich, da ich langsam ma los muß.

hab ma im forum gelesen dass, das geht:

FSCommand("save","datei.txt");

der speichert angeblich alle variabeln in der datei. hab ich noch nich versucht. hier hast du mal ein wenig origanl-text aus dem forum-beitrag:

Add a text field (Input) to the stage and name it:

txtInput

now add a button with the following actions:

on (release) {
fscommand ("exec", "command.com" add chr(9) add "/c" add chr(9) add "echo" add chr(9) add txtInput add ">>writeFile.txt");
}

You should find that Flash will write a text file called writeFile to your HD in the same folder as your Flash movie was launched from. If you want to specify a destination, you need to change the last part of the argument to read something like:

add ">C:\\fred\\writeFile.txt");
}

This should save it to a folder called fred in your root

hope this helps...


__________________________________________________

He he... why don't you try one hidden undocummented command...


FSCommand("save","file.ext");

and see what is goin on... it would save variables to hdd... btw. works only with flash 5...

hope this helped most


________________________________________________________
btw. to save .txt file from some variable using perl u can do like:

#!/usr/bin/perl
use CGI;
$req = new CGI;
$variable = $req->param("variable_name_from_flash");
open(FILE,">variables.txt");
print FILE "$variable";
close(FILE);
print "Content-type: text/plain\n\n";
print "return=true";
exit;

and in flash use loadVariables("path/cgi-bin/script.pl", "", vars="GET")

and put check for "return" variable... once it returns "true" value variable is saved

hope this helped u...

cu



_________________________________________________________________

Ok, right, I used
To load
loadVariables ("file:///C|/filename.txt", _root);
To save
fscommand ("save", "c:/" + "filename.txt");
It works.
But my project is a little bit complex and if I quit (and save) when I've initialized some variables, at the next re-start and re-load I have a lot of variables set wrong.
I read something about loading the txt into a MC and then setting the variables I used in the _root.
Not sure to be clear enough...
Fred





·kuat·
 
THX...

Hey THX...

...für die vielen beiträge die de mir kopiert hast...
Ich muss se aba erst mal alle durchprobieren...

Trotzdem mal danke Kuat

Mr.Mista
 
Zurück