Flash messes up when uploaded to a website

When I use the function loadVariables to load a .txt file into a text field (dynamically) [ by placing the action on the first frame] it works perfectly if I run (Test Movie) it from flash, but it doesn’t load on the website when the site first loads. However when I click a button which has the same code (loadVariables) to load the text it works on the website. What is wrong?

once that hapenned to me when loading text from xml, the problem was, that flash loaded the text, then it needed some other event to show it, but it was also by the way it was wrotten, I use this code and works very fine to load from txt:

objPath = new LoadVars();
objPath.load(“txt/somedoc.txt”);
objPath.onLoad = function() {
thatText = this.thatText;
};

tried it?

I don’t understand the code. I used

loadVariables("news.txt", _root);

to load the text.

could you show the hole code?

also what variabelname are you using in the textfile?

I would use the LoaqdVars class instead

Example
loader is a movieclip with the text loading (or something else, maybe some animation) and the instancename loader
in the textfile yourFile.txt put in a variabel like this
variabelName=
then after that put in your text in the textfile


myText = new LoadVars();
myText.load("yourFile.txt");
myText.onLoad = function(succes) {
 if (succes) {
  myText.htmlText = this.variabelName;
  loader._visible = false;
 } else {
 //if the textfile doesnt load or an error occours
  myText.htmlText = "Error loading textfile";
  loader._visible = false;
 }
};

the code above is clear enough? you can omit the validation if it troubles you.

objPath = new LoadVars();
objPath.load(“somedoc.txt”);
//“somedoc.txt” is the txt file that hold the data
objPath.onLoad = function() {
thatText = this.thatText;
//“thatText” refers to the instance name of the textfiled that receives the data
//“this.thatText” refers to th variable you named for your text
};

“somedoc.txt” is the txt file that hold the data,it should start:
thatText= Foo

try it

Thanks guys:)