How can I make this syntax right, have:
myCombBox is a combi box component.Code:package { import Array; import fl.data.DataProvider; import fl.controls.ComboBox; import fl.events.ComponentEvent; import flash.display.Sprite; public class SettingsMenu extends Sprite { public function SettingsMenuInit () : void { var items : Array = [ { label : "option1", data : "screenData1" }, { label : "option2", data : "screenData2" },]; myCombBox.dataProvider = new DataProvider (items); myCombBox.addEventListener(Event.CHANGE, newSelection); function newSelection (e:ComponentEvent) : void { //trace (myCombBox(e.target).selectedItem.data); } } } }
The problem is when adding the event listner to the combi box.
I get this errors:
1120: Access of undefined property Event.
I don't know what class to import or if there is something else wrong in the syntax.


Reply With Quote
