PDA

View Full Version : Combo Box Chaos - Probably Simple



chumps
August 13th, 2008, 05:32 AM
I have toured around the internet trying to find code that acts as a listener for my combo box. This code seems to work for everyone else but i keep getting the same error. Help would be lovely.



var cbListener:Object = new Object;

categorycombo_cb.addEventListener( change , cbListener);

cbListener.change = function(e:Object):void {

trace("Value changed to: "+e.target.selectedItem.label);

}
[code]1118: Implicit coercion of a value with static type Object to a possibly unrelated type Function.

Kosko
August 13th, 2008, 08:29 AM
use this :

categorycombo_cb.addEventListener( Event.CHANGE , onChangeHandler);
function onChangeHandler(e:Event):void {
trace("Value changed to: "+e.target.selectedItem.label);
}