And in the latter tutorial the text is treated like a variable, which I understand. Is it possilbe to alter the fomer tutorial to load the data as a variable and not HTML?
Thanks for your prompt relpy. In the tutorial written by Kirupa he loads the text as a variable.
loadText = new loadVars();
loadText.load(“data.txt”);
loadText.onLoad = function() {
name.text = this.name;
email.text = this.email;
location.text = this.location;
};
In this example the data is loaded as HTML, but does not contain HTML formatting.
on (release) {
loadText = new loadVars();
loadText.load(“TEXT1.txt”);
loadText.onLoad = function(success) {
if (success) {
// trace(success);
newsBox.html = true;
newsBox.htmlText = this.myNews;
}
};
}
I’m just wondering if this the best practice for using the data with button events, or is there a method to use kiupa’s method with the button events?
Thanks again,
I was wondering how to modify the second code example to omit the HTML formatting call. However if this is the best code to use, I’ll simply get some sleep.
on (release) {
loadText = new loadVars();
loadText.load(“TEXT1.txt”);
loadText.onLoad = function(success) {
if (success) {
// trace(success);
newsBox.html = true;
newsBox.htmlText = this.myNews;
}
};
}
Forget about the [font=Courier New]textfield.html[/font] property and use the [font=Courier New]textfield.text[/font] property to assign the variable in the textfile to the textfield: