Note that there are some explanatory texts on larger screens.

plurals
  1. POSaving textfield input
    primarykey
    data
    text
    <p>I'll explain a little before asking my question ... I've created numerous games which load and unload off a main menu.</p> <p>The player enters their name on the main menu before playing any games and when the player completes a game I want to save their time (taken to complete the game) and unload this time back into the main menu.</p> <p>Is there any way of saving the times using AS3 to a word document or something like this? I can't send the times to my website with php because the games will be used within a competition and it all needs to work with the internet.</p> <p>Any ideas guys?</p> <p>Edit:</p> <pre><code> var dataloader:URLLoader = new URLLoader(); var dataarray:Array = new Array(); // do this where you intialise other vars function preparesave() { dataloader.load(new URLRequest("savedata.txt")); } dataloader.addEventListener(Event.COMPLETE,savedata); function savedata (event:Event) { dataarray = event.target.data.split(/\n/); dataarray.push(MyTimer); var bytes:ByteArray = new ByteArray(); var fileRef:FileReference = new FileReference(); for (var i = 0; i &lt; dataarray.length;i++) { bytes.writeMultiByte(dataarray[i] + "\n", "iso-8859-1"); bytes.writeMultiByte('English Game Time: ',"iso-8859-1"); bytes.writeMultiByte(HourText.text.toString(),"iso-8859-1"); bytes.writeMultiByte(':',"iso-8859-1"); bytes.writeMultiByte(MinuteText.text.toString(),"iso-8859-1"); bytes.writeMultiByte(':',"iso-8859-1"); bytes.writeMultiByte(SecondText.text.toString(),"iso-8859-1"); } fileRef.save(bytes,"savedata.txt") } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload