# .txt file question

**URL:** https://forum.kirupa.com/t/txt-file-question/96663
**Category:** Uncategorized
**Created:** [December 12, 2003, 1:49am UTC](https://forum.kirupa.com/t/txt-file-question/96663 "2003-12-12T01:49:26Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![gcnmarcus](https://avatars.discourse-cdn.com/v4/letter/g/d9b06d/32.png) [@gcnmarcus](https://forum.kirupa.com/u/gcnmarcus)
#### Post date: [December 12, 2003, 1:49am UTC](https://forum.kirupa.com/t/txt-file-question/96663/1 "2003-12-12T01:49:26Z")

</div>

Hello,

I have tried several methods in the past to bring up text into flash at various degrees. So far, I have had to have some variable attached with the text in the .txt file before it could be read by the flash file.

This time, I need a way I can assign the whole text file to be retrieved regardless of naming it. What I am doing is generating a track .txt file which reports songs being played with usually the artist and title. Everytime it updates it saves over itself so I don’t have the opportunity to assign a variable with the text.

Is there a way to achieve this in Flash without needing to assign a variable to the text before it is brought into flash?

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [December 12, 2003, 10:51pm UTC](https://forum.kirupa.com/t/txt-file-question/96663/2 "2003-12-12T22:51:32Z")

</div>

hmm no not really, not unless you use a server side script

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [December 12, 2003, 10:55pm UTC](https://forum.kirupa.com/t/txt-file-question/96663/3 "2003-12-12T22:55:49Z")

</div>

```auto
myLV = new LoadVars ();
myLV.onLoad = function (success)
{
if ( success )
trace( unescape( this ) );
else
trace( "Failed" );
}
myLV.load("myTextfile.txt");

```

That should do it 🙂

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [December 12, 2003, 11:10pm UTC](https://forum.kirupa.com/t/txt-file-question/96663/4 "2003-12-12T23:10:20Z")

</div>

Thanks for the response. I will try that and let you know what happens. I will be testing this probably this weekend. It is 8am now and I probably won’t work on it in depth til Sunday.

However, I have about 3 hours before I have to leave so I will see if I can get it to at least read it.

in:

myLV = new LoadVars ();

Do I put a variable in the () like:

myLV = new LoadVars (trackinfo);

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [December 12, 2003, 11:22pm UTC](https://forum.kirupa.com/t/txt-file-question/96663/5 "2003-12-12T23:22:14Z")

</div>

Ok, It is properly retrieving info from the net or local drive but how can I use this to become part of a variable, don’t I need something like “newtext = trackinfo”
