Groups | Blog | Home
all groups > flash data integration > august 2005 >

flash data integration : undesired "onLoad" in a Dynamic ComboBox


Ben Baudart
8/18/2005 11:36:40 AM
Hi,

I have this code, generating items list in a ComboBox (instance name =
cbColor).
But for some unknown reason there's an item appearing in the list called
"onLoad".

It shouldn't be here, how come it appears in the list?

The "output.txt" file contains this:
&item1=value1&item2=value2&item3=value3

Thanks for your help...

Ben





function sendValue(obj):Void {
trace(obj.target.selectedItem.label);
}

function chargement(success) {

_root.cbColor.enabled=true;

for(var i in this) _root.cbColor.addItem(i,this[i]);
cbColor.sortItemsBy("data", "ASC");
}

my_lv = new LoadVars();
my_lv.onLoad = chargement;
my_lv.load("output.txt");

_root.cbColor.addItem("titre");
_root.cbColor.enabled=false;
_root.cbColor.selectedIndex = 1;
_root.cbColor.addEventListener("change", sendValue);

stop();
Kree8R
9/14/2005 9:32:18 PM
the "onLoad" is there to check if the external text is loaded
and when it is, calls the "chargement" function...
so as your code is written... it is needed there.


[quoted text, click to view]

AddThis Social Bookmark Button