PDA

View Full Version : problem with combobox


yodalr
10-17-2005, 08:20 PM
how to add items from external file to flash component combobox? Any ideas?

here's the current code:
//cars is the combobox instance
//car1 is the variable from replaycars.php file and it equals to KIT
_root.loadVariables("replaycars.php");
cars.addItem(car1);
cars.addItem({data:2, label:"second value"});
cars.addItem({data:3, label:"third value"});

cancerinform
10-17-2005, 09:14 PM
try this but check the syntax since i don't have flash here.

//car1 is the variable from replaycars.php file and it equals to KIT
var lv:LoadVars = new LoadVars();
var lvAnswer:LoadVars = new LoadVars();
lv.sendAndLoad("replaycars.php", lvAnswer, "POST");
lvAnswer.onLoad = function(){
cars.addItem(car1);
cars.addItem({data:2, label:"second value"});
cars.addItem({data:3, label:"third value"});
}