.txt file question

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?

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

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

That should do it :slight_smile:

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);

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”