flash question "undefined"
- Started
- Last post
- 9 Responses
- qaddisin
loading some external data.
when i test no problem.
when i simulate 56k i get "undefined". WTF. code below. thanks.-----------------------------
textfield named: col1Top
on actions layer:loadVariables("content.txt", this);
var flashcss = new TextField.StyleSheet();
flashcss.load("flash.css");
flashcss.onLoad = function(success) {
if (success){
col1Top.styleSheet = flashcss;
col1Top.htmlText = eventNews;
}
};
- unfittoprint0
You have to do the actions sequentially. First retrieve the variables, then tretrieve the stylesheet.
//loadVars
myVars= new Loadvars();
myVars.onLoad = function(sucess){
flashcss.load("flash .css");
} else {
trace("load vars error!")
}
};//load StyleSheet
flashcss = new TextField.StyleSheet ();
flashcss.onLoad = function(success) {
if (success){
col1Top.styleSheet = flashcss;
col1Top.htmlText = eventNews;
}else{
trace("error stylesheet");
};//start the process
myVars.load("content.txt");
- qaddisin0
sounds about right. thank you very much. take care.
- ********0
unfit to the rescue, everytime! :)
- ********0
how can any one human know so much?
- ********0
he is a god, make no mistake
- shaft0
"when i simulate 56k"
Chill out, man. You're not the only one around here who does that.
- qaddisin0
shaft. when you test a flash movie you can change the download simulation settings and set it to certain kbs per second in the flash authoring environment. just thought you might want to know.
i was inspired by unfittoprint and re-organized the code. now it works great. thanks again.
flashcss = new TextField.StyleSheet();
flashcss.load("flash.css");
flashcss.onLoad = function(success) {
if (success) {
col1Top.styleSheet = flashcss;
} else {
trace("Error loading stylesheet.");
}
};loadText = new LoadVars();
loadText.load("content.txt");
loadText.onLoad = function(success) {
if (success) {
col1Top.htmlText = this.eventNews;
} else {
trace("Error loading data file.");
}
};
- ********0
yep
- shaft0
qaddisin.. well.. uh, seems my joke was not a good one since you didn't get it :(
I've been a bandwith profiler satisfied user, thanks :)
My "56k simulating" was related to.. just search recent threads for "56k" and quickly you will know what I'm making fun of - certainly not you ;)