# Writing to external .txt files

**URL:** https://forum.kirupa.com/t/writing-to-external-txt-files/117345
**Category:** Uncategorized
**Created:** [July 26, 2004, 8:00pm UTC](https://forum.kirupa.com/t/writing-to-external-txt-files/117345 "2004-07-26T20:00:03Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![demonsbreath](https://avatars.discourse-cdn.com/v4/letter/d/b19c9b/32.png) [@demonsbreath](https://forum.kirupa.com/u/demonsbreath)
#### Post date: [July 26, 2004, 8:00pm UTC](https://forum.kirupa.com/t/writing-to-external-txt-files/117345/1 "2004-07-26T20:00:03Z")

</div>

How do you write to external .txt files so that you can read from them like this;

```auto
on (release) {
    loadText = new loadVars();
    loadText.load("hiscore.txt");
    loadText.onLoad = function(success) {
        if (success) {
            // trace(success);
            scoreBox.html = true;
            scoreBox.htmlText = this.hiScore;
        }
    };
}

```

then there would be a text file called hiscore.txt and it would have

```auto
hiScore; 28000

```

for example

---

<div class="post-metadata">

### Author: ![stringy](https://avatars.discourse-cdn.com/v4/letter/s/919ad9/32.png) [@stringy](https://forum.kirupa.com/u/stringy)
#### Post date: [July 26, 2004, 8:08pm UTC](https://forum.kirupa.com/t/writing-to-external-txt-files/117345/2 "2004-07-26T20:08:41Z")

</div>

> [@demonsbreath](#):
>
> How do you write to external .txt files so that you can read from them like this;
> 
> ```auto
> on (release) {
> loadText = new loadVars();
> loadText.load("hiscore.txt");
> loadText.onLoad = function(success) {
> if (success) {
> // trace(success);
> scoreBox.html = true;
> scoreBox.htmlText = this.hiScore;
> }
> };
> }
> 
> ```
> 
> then there would be a text file called hiscore.txt and it would have
> 
> ```auto
> hiScore; 28000
> 
> ```
> 
> for example

you need something serverside. In the “Best of” forum i seem to remember a well written tutorial on this using PHP.
