use this instead (attach ur function to an object)
var Listener_obj:Object= new Object();
Listener_obj.change=function(evt:Object)
{
trace("new Selected Index="+evt.target.selectedIndex);
}
myCmb.addEventListener("change",Listener_obj);
myCmb.selectedIndex=2;
the reason behind this, is that you
This is the intended behaviour. You should fire the change event
yourself. The reason being, know you changed it, so you can call or do
anything else you like at the same time. It's only when the user
interacts with a component that you want to detect.
Chris
--
Chris Velevitch
Manager - Sydney Fl
function change() {
trace("change");
}
MyCmb.addEventListener("change", this);
MyCmb.selectedIndex = MyCmb.selectedIndex + 1;
Does not fire a change event. How do I detect when the combo box has
changed from code not from direct user interaction with the component? This
seems completely
3 matches
Mail list logo