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!
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!