[F8] Writing To A Text File
I am creating a game of "snake" and need to be able to write the end score and the name of the person who played the game to a text file in the users documents, as the end file will be a .swf for an assignment I was wondering if this was possible and if so, what code I would have to use.
The code I am using for the game is similar to this code: http://www.strille.net/tutorials/snake/index.php
thanks in advance if you can help.
steph.
FlashKit > Flash Help > Flash ActionScript
Posted on: 02-20-2008, 06:00 AM
View Complete Forum Thread with Replies
Sponsored Links:
Writing To A Text File ---help
i need to have flash write to (update) a text file everything will all run local. flash swf/exe and text are all on the same machine this will be a local presintation.
this will be communicating with a visual basic app.
help!!!!!!
please call i f you cant explane
714.372.5344 huntington beach california
thank you
View Replies !
View Related
Writing To A Text File
Can Flash's Action Scripting write to a text file and read from the same file like a sort of database? Can the Action Script also append more data to the text file? If so, can someone point me to a tutorial or Web site tutorial illustrating the techniques involved?
Thanks in advance,
Chris G ~`^%
View Replies !
View Related
Writing To A Text File? Can It Be Done?
Can Flash when published as an EXE or a web based SWF write to a Text File?
If so does it add to the existing text or over write it?
Can Flash create a New text file to write to?
Just simple yes or no is fine but if you know how one or more of these things is done a description of how would be fantastic!
View Replies !
View Related
Writing To A Text File
Anyone know of a tutorial available that will allow me to write from an input form to a .txt file? I have PHP, and ASP available to process it.
Basically, I just want to write one variable's contents into a text file. Shouldn't be to difficult but i cant find any resources out there.
Thanks
View Replies !
View Related
Writing To A Text File
i am making an application that is stored on a CD. the user pops in the cd and d-clicks the main SWF to start the app. i need to read/write to text files. id be stupid to assume that the client machine has a specific backend script -- how can i do simple writes to a text file in this situation?
thanks
View Replies !
View Related
Writing To A Text File
I have set up a movie so that 4 text boxes read variable's from a text file. Here is the code:
Code:
&date01=01/12/05
&title01=The Weeping Camel
&blog=
&time01=2:48AM
This is what is contained inside the text file.
Code:
loadVariablesNum("December.txt", 0);
This loads the variables. This all works fine. I am trying to write from an input text box back into the the text file. Can anyone please help??
View Replies !
View Related
Writing To Text File
could anyone please explain the most straightforward way to write variables from Flash 8 into a text file? from my Googling i discovered that certain fscommands could do it, but that this was an undocumented feature that only worked up to Flash 5 and with older versions of the standalone player.
the only condition is that the system of writing must work offline. presumably this means that a php script would not be the best solution? would something like javascript be able to do the job?
thanks in advance for any help.
View Replies !
View Related
Writing To Text File
Is there any way to write a text file on the hard disk (without using shared docs) using flash 8. I want to develop a simple application which will save and retrieve chracters from the text file.
Thanks in advance
View Replies !
View Related
Writing A Text File From A Swf?
I am trying to develop a Flash site with text that is editable from the SWF file. The editor could log in via a password > dynamic text fields become input text fields which could be edited and THEN I need a method for writing the information somewhere so it can be loaded back in.
This is a small brochure site and I think a database is a little over-kill, and too expensive.
Anyone have any suggestions of methods for writing to a text file? Is it possible (I mean easy) to write a text file from Flash?
(I have looked for tutorials, if there are any I'm missing them)
View Replies !
View Related
Writing A Text File From A Swf?
I am trying to develop a Flash site with text that is editable from the SWF file. The editor could log in via a password > dynamic text fields become input text fields which could be edited and THEN I need a method for writing the information somewhere so it can be loaded back in.
This is a small brochure site and I think a database is a little over-kill, and too expensive.
Anyone have any suggestions of methods for writing to a text file? Is it possible (I mean easy) to write a text file from Flash?
(I have looked for tutorials, if there are any I'm missing them)
View Replies !
View Related
Writing To A Text File
i am able to write to a text file within Player via a server script, ie. the Flash movie sends the value to a aspx page (for example) which in turn prompts the user to save the text.
just wondering could i do it entirely on the client side, much like what JSave does?
View Replies !
View Related
Writing To External Text File
I'm looking for a way to write a set of variables in Flash 5 to an external text file. So far the only thing I've read indicates that it is possible with ASP. If so, is there a Flash/ASP tutorial on this site? Is there another way to write to a file using something within Flash 5?
View Replies !
View Related
Writing A Text File To Your Computer?
does anyone know of a way you could have your .exe flash file send variables to be saved to a text file on your computer.
I know you need to have some intermediary script in perl or something I'm guessing. but does anyone know where I could find a script to do this?
thanks
Jason
View Replies !
View Related
Flash WRITING To Text File?
Okies, we all know that flash can read from text files, but is there any simple way of making flash WRITE to text files? Anyone have any ideas based on plugins, directx, anything at all that they can tell me how to use?
View Replies !
View Related
Writing Varibles To A Text File
is it possible for flash to take varibles and write them to an external text file on my web space...and beyond that...is it possible for flash to create a new text file on my web space and name it based on the name of a varible string...how would you go about doing something like this?
james
View Replies !
View Related
Writing To An External Text File
hey guys
Im trying to write a data capture login page for a site and wondered, Is there any way flash can simply add an input name & email address to a list without using cgi?
However if I use CGI how do you pass the variables to it...
any help would be much obliged
cheers
View Replies !
View Related
Writing To Local Text File?
Is there a way to write data into local text files in my hdd rather than thru the server ? i recall last time i read something about the unsupported write function that allow you to write to a file in your harddrive.
Can someone slightly teach me how to use the write function please ?
View Replies !
View Related
Writing To A Text File => Problems
Hi there,
I'm running an app on my PC here which loads variables from text files. Those variables are placed into input text fields and can be edited. (It's about a list of names)
How can I save the changes I made to those names? Do i HAVE to use a script for that or is there a special way to do this in Flash MX? I'm using MX now but I haven't used Flash since Version 4.
Regards
2 Design
View Replies !
View Related
Writing To A Text File On A Server
Hi,
I know its pretty straight forward to load a .txt file or variables from a .txt file with "loadvariables", in Flash 5, but how would i write a number to a .txt file ? (so a number is recorded in the text file, to be recalled some other time)
thanks for any help
phil.
View Replies !
View Related
Writing Data To A Text File
Hi,
I have a movie in which there is a scene that requires the user to enter a code to view some content. The code can be a mixture of digits and characters.
I want to be able to track who enters the content view section by recording their access code, along with the date and time, in a text file.
Is it possible to write data to a text file from flash like this?
Any help would be great.
Thanks.
View Replies !
View Related
Writing To An External Text File....
Hello - I was wondering if the following was possible, and if so then how it would be accomplished....
Let's say I have a text file called "textfile.txt". The contents of the text file are the following:
array1=a|b|c
&array2=d|e|f
Now, what I want to do is make a Flash file in the same directory that the .txt file is in. I want to be able to input values into fields in the Flash file that will change the values of "a" "b" "c" "d" "e" & "f" inside the .txt file....
The thing is that I don't necessarily need them to be changed as variables inside the Flash file - my ultimate need is to actually change the contents of the .txt file itself. Is this possible using actionScript, and if so how would I go about doing it?
Thanks for the help - this is a great forum, and you are all very knowledgeable!....
View Replies !
View Related
Writing To Local Text File
Hello,
I'm trying to develop a small quiz type flash application.
It will not be developed for use on the net, so I can't use any PHP etc... Only the utilities on a basic computer system.
I need to be able to have a variable called q1, and 4 linked variables a1, a2, a3, a4.
I will then have 10 text files (1, 2, 3, 4 etc...)
When q1, a1, a2, a3, a4 are submitted they overwrite what is in the relevant text file.
I am not sure what form they have to be written in to be seen as variables, and how to call multiple variables from a text file?
I don't really want to have to make 50 text files for the quiz, so is there a way to condense it down into 10, or even 1?
Many thanks,
W.
View Replies !
View Related
Writing To A Text File In Flash Mx
I'm making a website for my friends band. The website is pretty simple but i want to add (he wants me to add) an input box on the front page. This input box will be where u type in your email address to be added to a text file. I need some code help with this one, im not sure how to do it in flash. I have a good grasp of c++ programming so you wont have to explain the code to much i catch on pretty quick. I could probably figure it out once i had help finding the syntax. I assume it would be a box with a enter button beside it which actually did the writing to the file. Also maybe to make it a little tricky, check to see if that address had already been entered, and maybe to check if it is a valid email address and return the appropriate error msg or "email added" response.
Thanks in advance,
Acid
View Replies !
View Related
Flash & PHP - Writing To A Text File
Hello one and all,
I am trying to create a simple form in flash http://www.prestigeinteractive.com/mcgibbys2/main.html that asks for a person's Last Name, First Name, and email address.
The code for the submitt button is as follows:
on (release) {getURL("write_to_file.php", "_new", "post");
Once the button is selected, the information acquired by the form is then sent to my php script. I then want my script to write the information received in the flash form to a text file. The code for my PHP file is as follows:
<?php
$f=fopen("text_file.txt","a");
fwrite($f, " **************************************************
*
");
fwrite($f, " Last Name: $l
");
fwrite($f, " First Name: $f
");
fwrite($f, " Email: $e
");
fclose ($f);
echo "<br><br><b>Your address has been sent successfully!<br>Thank-you for Joining the McGibby Emailing List!</b>";
?>
When I activate the above scripts, it works, except for the fact that when it goes to write the first name on the txt file, it writes the following "Resource id #1".
I hope someone can help me.
Thanks in advance,
Greg
ps. I know I should have some error handling codes, but that is a battle for another day.
View Replies !
View Related
Writing LoadVars To A Text File
I"m trying to write some vars to a text file, but can't seem to make it happen. I can get it to work correctly w/ php, but not a .txt file. How do i set up the text file to get it "POST" or "GET" ready? Is there a difference per method in the .txt file? I already know how to load data through var1=value&var2=value2 etc. I've tried using this method with blank values and can't get it to work either. No error code.... pleasssseee help. If you're asking y not use PHP, I need to stay away from a dbase (just a small amount of data).
View Replies !
View Related
Writing To A Text File From Offline Swf
Hi.
I have a quiz in an SWF that is run offline. I would like a number of variables from within the quiz to be sent to a text file. So each time someone takes the the quiz it adds their details to the text file. (If it makes any difference, the SWF file is never reloaded).
Is there an easy way to do this? and which is the best way? ive searched but have had problems finding an answer to what I thought would be a common problem.
Any suggestions on how best to do this would be great. The easier the better
Many Thanks
Simon
View Replies !
View Related
Writing To Text File Via Dreamweaver
Hey,
Sorry about posting another thread so soon and I know that this has been asked many a times before, but the search function here was going all screwy for me so I decided to just ask it striaght up.
Anyways, I have an input text box that when a button is clicked, needs to have the content stored inside sent to a text file. I thought it would have been possible to send it straight to the text file like you would load from, but apparantly that's not avaibable anymore and requires a 3rd party program.
Well I have absolutly no knowledge in any 3rd party program that could do this, but I do have Dreamweaver on my computer here.
So Im asking, can someone please explain how I would simply send contents from an input box (from flash) to a text file in the same directory?
Thanks
View Replies !
View Related
Writing To Text File - Offline
could anyone please explain the most straightforward way to write variables from Flash 8 into a text file? from my Googling i discovered that certain fscommands could do it, but that this was an undocumented feature that only worked up to Flash 5 and with older versions of the standalone player.
the only condition is that the system of writing must work offline. presumably this means that a php script would not be the best solution? would something like javascript be able to do the job?
thanks in advance for any help.
View Replies !
View Related
Writing To Text File Via Php Using LoadVars
i've provided a couple links below, so you can get a better idea of what's going on. at the first link i have a basic swf (for simplicity's sake) that's being used to write a number variable to a .php file, and then retrieve the value of that variable when a button is pressed. take a look:
http://www.unconstruct.com/storage/PHPtest7.swf
basically when the user adds value to the number using the first button, the tracker textbox logs the incrementation. at any point, the user can hit send, which shuttles the value of the variable to the php, which then spits it out again using the print command. the swf then grabs the value anew using another LoadVars object, and displays it in the textbox.
after some chipping away at it, i managed to get it working like i need it to using the following:
actionscript:
Code:
var nValue:Number = new Number(0);
var result_lv:LoadVars = new LoadVars();
var send_lv:LoadVars = new LoadVars();
changeValue.onPress = function() {
nValue++;
tTracker.text = nValue;
};
submit_vars.onPress = function() {
result_lv.onLoad = function(success:Boolean) {
if (success) {
tResultHolder.text = result_lv.nValue;
} else {
tResultHolder.text = "Error connecting to server.";
}
};
send_lv.nValue = nValue;
send_lv.sendAndLoad("StoresValue.php", result_lv, "POST");
};
PHP script:
PHP Code:
<?php$nValue = $_POST['nValue'];print"nValue=" . $nValue .""?>
where $nValue in the php is referencing flash's variable of the same name (nValue ) and is subsequently read back in as a property of the "result_lv" LoadVars object.
okay. now due to the end-purpose of this setup, i need to have the php actually write the value of that variable nValue elsewhere (to a text file) , and have the LoadVars grab it in essentially the same fashion. the difference being that the text file offers more concrete storage of the value, which is what i need. dunno if that makes total sense but it seems like it should work for the most part.
anyway i figured i could modify the php a bit while keeping the actionscript essentially the same, so i came up with this:
PHP script:
PHP Code:
<?php$nValue = $_POST['nValue'];$filename = "StoresDistrictValue.txt";$handle = fopen($filename, "w"); fwrite($handle, "$nValue");$contents = fread($handle, filesize($filename)); fclose($handle);print"nValue=" . $contents .""?>
to this end, i went ahead and made a modified version of the basic swf from before, and simply pointed it to the new php script. here's a link:
http://www.unconstruct.com/storage/PHPtest8.swf
coupled with the above, if you manually refresh/reload the page (see link below), you'll see that the txt file is indeed being written to with updated values, based on the value at which the user pressed the button:
http://www.unconstruct.com/storage/S...trictValue.txt
obviously though, the value isn't getting displayed in flash. i cobbled together bits of a tutorial i had found on writing to a txt file via php, so that's where i snagged the extra bits of that php from, but for some reason i can't seem to get the value of that number back in flash like before. the actionscript is essentially the same (all i did was change "StoresValue.php" to "HoldsValue.php" in the sendAndLoad line to account for the different URL). i have no idea what's going on.
part of me thinks the shortcoming is on the flash end, and the way i'm referencing the variable nValue. the other side of me thinks it might have something to do with the manner in which the php script is assigning the value of $contents. it's my understanding $contents needs to equate to the contents of the text file (ie, the value being written there), so that i can then set that as the 'updated' value of nValue back in flash.
any thoughts? i'd appreciate it immensely. it's been driving me nuts for hours!
View Replies !
View Related
Writing A Text Or Ascii File
My application is written using Flash MX with lots of action script. I have to output a text file that will contain xml data - send that text file to a blackbox calculation engine. That blackbox engine will then output a text file which contains data that must be read back into the Flash application.
I was told that mmsave was what I could use - I did it but now I am told that this is only a debugging feature.
MMSave(mystring,MyDir)
What would I use to output a text file in a directed location i.e. c:mmtextfile*.* using ActionScript?
Are there other solutions ?
Thanks in advance
View Replies !
View Related
Help With Writing To Text File: Basic Php May Be
I'm trying to write some text to a text file. Actually, i retrieved the text from the file simply without using any PHP, so i thought there might be a way to write back to it without PHP too. Is there?? i couldn't find any through flash help files though..
Anyways, so i started trying to use PHP for it. I wrote some code so that it took some text from a dynamic text box on stage, and would write it into a text file in a folder inside the one which contains the swf and the php file.
here is the code:
Actionscript:
Code:
//Inside the button i press to send the code:
on(release)
{
var data_lv:LoadVars = new LoadVars();
var send_lv:LoadVars = new LoadVars();
data_lv.notes = _root.notesCont.nt.inside.notepad.notes_txt.text;
//i know thats a lot of nesting of movieclips, but the path is fine
//i checked.
send_lv.sendAndLoad("notesPhp.php",data_lv);
}
here's the php code in notesPhp.php file located in the same folder.
Code:
<?php
$nValue = $_POST['notes'];
$filename = "/userName/myNotes.txt";
$handle = fopen($filename, "w");
fwrite($handle, "$nValue");
fclose($handle);
?>
But the file myNotes doesnt get written.. Its inside the userName directory. Where is the mistake? i am very new to php so i have no clue what might be going wrong there. i might be writing the path incorrectly or anything
Also, i dont really get the hang of sendAndLoad function. As in, why i need to use the data_lv object necessarily.
So how exactly DO i send the text from a dynamic text box to a file??
Is there some way around php for this too??
Whats wrong with this code?
View Replies !
View Related
Open And Writing To Text File?
Hi,
I'm somewhat new to Flash CS3 and I was wondering what was the best way to open a text file and write to it as well. I know with Actionscript 2 loadVariablesNum did the job, but Actionscript 3 doesn't seem to support that.
Basically I have an application that keeps the score of a user, and I want the user to be able to enter their name and then the name and their score will be written to a txt file. Any help would be appreciated, thanks.
View Replies !
View Related
Writing Multiple Variables To A Text File
Hi
I have a number of symbols(many)and hotspots (many) in a movie. When each symbol moves over a hotspot the movie must open a text file and write the details to it. i.e.
Symbol 1
Symbol 2
Hotspot 1
Hotspot 2
When Symbol 1 is passed over Hotspot 1. it writes to a text file.
"Symbol 1, Hotspot 1".
Similarly if Symbol 1 is passed over Hotspot 2. it writes to a text file.
"Symbol 1, Hotspot 2".
Writing to the file is straight forward enough but how can I get it to write which symbol did the rolling over?
thanks in advance
The end application will be a circuit board where users can effectively wire up circuits and test points on the circuit. The symbol will be the connector on a piece of test equipment and the hotspot a test point.
View Replies !
View Related
Writing Variables From Flash To Text File
Hi,
I'm using Flash MX/Php.
I have a lot of variables (100s, including arrays) in Flash, that I want to store in a .txt file. I know its possible to write variables to a .txt file using php, but what if you have a LOT of variables to write?, and how can you best organise them in the actual text file? I don't want to use a sql database, it has to be a text file.
thanks
phil.
View Replies !
View Related
Dynamic Text File. Not Writing To Properly
Hi,
This is slightly long explanation of my problem but hopefully you can help me out.
I have 5 input boxes var named line1, line2, line3 etc...
These input boxes are populated automatically on load by:
Code:
var lv:LoadVars = new LoadVars();
lv.onLoad = function() {
line1 = lv.txt1;
line2 = lv.txt2;
line3 = lv.txt3;
line4 = lv.txt4;
line5 = lv.txt5;
};
lv.load("textFile.txt?something="+new Date().getTime());
The text that populates these inpout boxes are from textFile.txt:
Code:
&loaded=yes&
&speed=30&
&txt1="Text1"&
&txt2="text goes here"&
&txt3="and here"&
&txt4="Here too"&
&txt5="Finally here"&
The code behind my 'saveBtn' is:
Code:
on (release) {
loadVariables("writefile.php", "0", "POST");
}
However upon the user editing the text in line1,line2 etc.. and clicking on the save button the code written to the text file misses out all of the variables in these line1,line2 boxes and only prints this:
Code:
&loaded=yes&
&speed=30&
&txt1=&
&txt2=&
&txt3=&
&txt4=&
&txt5=&
This leads me to beleive that the 'line' variables need to be declared sumwhere on the save button function??
My writephp file code is:
Code:
<?php
$filename = "textFile.txt";
$fd = fopen ($filename, "w");
$myText= "&loaded=yes&" . "
";
$myText.= "&speed=30&" . "
";
$myText.= "&txt1=" . $line1. "&" . "
";
$myText.= "&txt2=" . $line2. "&" . "
";
$myText.= "&txt3=" . $line3. "&" . "
";
$myText.= "&txt4=" . $line4. "&" . "
";
$myText.= "&txt5=" . $line5. "&" . "
";
fputs ($fd, $myText);
fclose ($fd);
?>
Any ideas why the text is not writing to the file properly??
Thanks very much
View Replies !
View Related
Writing Data To External Text File
I am creating a voting website. Viewers need to be able to nominate a candidate and I want the list of candidates to then be updated with the new nominee. Can you do this with an external text file that loads into a dynamic text box? How can I write the new nominee to the external file, so that the external file has the complete list as people add to it? Can I prevent the file from having duplicate nominees?
View Replies !
View Related
|