Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

LoadVarsText

Status
Not open for further replies.

Kirderf

Technical User
Oct 4, 2000
183
US
I am having trouble figuring out how to load different text files from an outside source into my flash movie.

The initial load works, but when I try to load a new text document into the same textbox (from a different frame) I get an error.

Here is my code I am using.

Code for frame 1 of movie.

loadVarsText = new loadVars();
loadVarsText.load("corporate.txt");
//assign a function which fires when the data is loaded:
loadVarsText.onLoad = function(success) {
if (success) {
trace("done loading");
//Now that we know the data is loaded,
//set the text content of the Text Field
//with the instance name "scroller" equal to the
//contents of the variable
scroller.text = this.var1;
} else {
trace("not loaded");
}
};



Code for frame2
stop();


Code for frame 3
loadVarsText = new loadVars();
loadVarsText.load("leisure.txt");
//assign a function which fires when the data is loaded:
loadVarsText.onLoad = function(success) {
if (success) {
trace("done loading");
//Now that we know the data is loaded,
//set the text content of the Text Field
//with the instance name "scroller" equal to the
//contents of the variable
scroller.text = this.var1;
} else {
trace("not loaded");
}
};

I am just changing the text file name.-but getting an error.

Is there another way?

I'd gladly pay you on Thursday
for a hamburger today!
 
oops, I found a syntax error. The l in new loadVars()

should be a capital "L" new LoadVars()

Thanks for reading. sorry to bother

I'd gladly pay you on Thursday
for a hamburger today!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top