# Writing to External Text Files

**URL:** https://forum.kirupa.com/t/writing-to-external-text-files/182436
**Category:** flash
**Created:** [March 18, 2006, 6:36am UTC](https://forum.kirupa.com/t/writing-to-external-text-files/182436 "2006-03-18T06:36:17Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![JonathanCarter](https://avatars.discourse-cdn.com/v4/letter/j/e19b73/32.png) [@JonathanCarter](https://forum.kirupa.com/u/JonathanCarter)
#### Post date: [March 18, 2006, 6:36am UTC](https://forum.kirupa.com/t/writing-to-external-text-files/182436/1 "2006-03-18T06:36:17Z")

</div>

I have an external file highscores.txt, which my game opens. It finds the 3 variables in it and compares them to the score that the user got and determines if they beat it or not. If they beat the high score, I want it to re-write the variables in the file, which are “name”, “seconds”, and “minutes”. Here is how I open the file and get the data.

> 

loadText = new LoadVars();  
loadText.load(“highscore.txt”);  
loadText.onLoad = function() {  
name.text = this.name;  
seconds.text = this.seconds;  
minutes.text = this.minutes;  
highseconds = this.seconds;  
highminutes = this.minutes;  
};

Can somebody tell me how I can write in the file using flash? Thanks!
