loader = new LoadVars();
loader.onLoad = function(){
loader.load (thefile.asp)
I am at home now and I cant rember the code I used, but the list box is useing a loop function that reads the numer of strings and labels them song1,song2,song3 ect…
var list = new Array();
loader = new LoadVars();
loader.onLoad = function() {
var n = 1;
for (var i in loader) {
trace(i+": “+this*);
// split the label from the data
var list = this*.split(”|");
// fill the combobox
combobox.addItem("Read profile “+n+” "+list[0], [list[1]]);
n = n+1;
}
};
loader.load(“http://www.file.asp”);
by using “&” in the variable file, the loadvars object is interpreting it as a list of variables in name value pairs. but there are no “=” so essentailly, it’s a list of variable names, with no values attached.
you could use “=” in the file.asp, or, i think your existing code will work if you reference the variable name rather than its value (since it has no value).
note where i’ve written “i” instead of “this*”:
loader = new LoadVars();
loader.onLoad = function() {
var list,n;
for (var i in loader) {
n++;
list = i.split("|");
combobox.addItem("Read profile "+n+" "+list[0], list[1]);
}
};
loader.load("http://www.file.asp");
are you doing anything with list[2]? you seem to have three components to each variable.
i might also add that it’s a little unorthodox to be splitting the variable name. it’s only flashes permissive casting that lets you get away with that.
ily - with this (moderately whacked, but hey, if it ain’t broke…) method of importing data it’s the names of the variables that contain the data, as opposed to their values. thus in a for(i in this) loop, i contains the relevant data as opposed to this*.