views:

1828

answers:

1

I'm trying to use the combobox component for Flash. I can't get the change event to fire. My code is pretty much straight of of the adobe site (link below). The box gets populated but changing the value produces no trace output. What am I doing wrong? Thanks

http://livedocs.adobe.com/flash/mx2004/main_7_2/wwhelp/wwhimpl/js/html/wwhelp.htm?href=00002149.html#3138459

myCombo.addItem("hi1", "hi5");
myCombo.addItem("h2", "hi6");
myCombo.addItem("hi3", "hi7");
myCombo.addItem("h4", "hi8");

var form = new Object();
form.change = function(eventObj){
   trace("Value changed to " + eventObj.target.value);
}

myCombo.addEventListener("change", form);
+1  A: 

I pasted your code into an AS2 project and it worked as expected for me. No other output? Try adding a trace before and after the addEventListener to make sure it's getting called. Try using a name other than form for your object. Try running it in debug and set a breakpoint in the change function.

Gerald