# Simple way of loading a var from a file and replacing it with an updated version?

**URL:** <https://forum.kirupa.com/t/simple-way-of-loading-a-var-from-a-file-and-replacing-it-with-an-updated-version/326980>\
**Category:** flash\
**Created:** [January 28, 2012, 4:30am UTC](https://forum.kirupa.com/t/simple-way-of-loading-a-var-from-a-file-and-replacing-it-with-an-updated-version/326980 "2012-01-28T04:30:59Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![tenchy](https://avatars.discourse-cdn.com/v4/letter/t/f08c70/32.png) [@tenchy](https://forum.kirupa.com/u/tenchy)\
**Post date:** [January 28, 2012, 4:30am UTC](https://forum.kirupa.com/t/simple-way-of-loading-a-var-from-a-file-and-replacing-it-with-an-updated-version/326980/1 "2012-01-28T04:30:59Z")

</div>

Hi, I would like to have flash (as3) to save a var to a text file located on my [[COLOR=darkgreen]server[/COLOR]](http://board.flashkit.com/board/showthread.php?p=4295704#) so everyone can reach it from their client swfs. I also need to know how to update this variable by loading latest var on the server and writing over it with a new updated var.

I’ve read so much already and it all seems so confusing ![](http://forum.kirupa.com/uploads/kirupa/3617/361341c146e0850c.gif)

[http://www.kirupa.com/forum/showthre…S3-PHP-Notepad](http://www.kirupa.com/forum/showthread.php?306368-Newbie-tutorial-AS3-PHP-Notepad)  
[http://www.flash-db.com/Tutorials/sa…ata.php?page=7](http://www.flash-db.com/Tutorials/savingAS3/savingData.php?page=7)  
[http://www.flash-db.com/Tutorials/sa…ata.php?page=2](http://www.flash-db.com/Tutorials/savingAS3/savingData.php?page=2)  
[http://www.flash-db.com/GuestBookTut/](http://www.flash-db.com/GuestBookTut/)

For example, I could have a file called hello.text on [http://www.randomsite.com/game/hello.txt](http://www.randomsite.com/game/hello.txt) which contains:

variable=potatoe

I would like to, whenever I feel like it, be able to load that var and replace it with something else.

Any simple solution for this?

Many thanks in advance.
