View Full Version : Loading text from external source
El Bicho
January 26th, 2004, 11:47 PM
In the tutorial with that name there is this code:
on (release) {
loadText = new loadVars();
loadText.load("TEXT1.txt");
loadText.onLoad = function(success) {
if (success) {
// trace(success);
newsBox.html = true;
newsBox.htmlText = this.myNews;
}
};
}
What´s the purpose of this part?
function(success) {
if (success) {
Is there any chance for "success" to be false?
Maizoon
January 26th, 2004, 11:53 PM
I would assume that if TEXT1.txt did not exist or the path to it was wrong...then success would be false no?
El Bicho
January 27th, 2004, 01:07 AM
Yes, I think so but publishing the movie with or without that lines makes no difference. If text1.txt does not exist nothing happens, no matter that those lines are in the code or not...
brian monkey
January 27th, 2004, 06:45 PM
you add the extra code in here and then it would do something if success was a failure. :)
on (release) {
loadText = new loadVars();
loadText.load("TEXT1.txt");
loadText.onLoad = function(success) {
if (success) {
// trace(success);
newsBox.html = true;
newsBox.htmlText = this.myNews;
} else {
newsBox.text = "text did not load!";
}
};
}
just an idea,
brian
flash_legend
January 28th, 2004, 04:35 AM
well,,,,,i think it has to be like that
on (release) {
loadText = new loadVars();
loadText.load("TEXT1.txt");
loadText.onLoad = function() {
scroller.text = this.text;
};
}
try to use it might be helpfull
Voetsjoeba
January 28th, 2004, 07:01 AM
This link might help:
http://www.macromedia.com/support/flash/action_scripts/actionscript_dictionary/actionscript_dictionary433.html
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.