I want to pass a variable to a function called by an addEventListener, but when i try to do it, it doesnt pass the event itself to the function. For example, i have
item.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, me);
and...
private function me(event:ContextMenuEvent):void {
and i try something like that, but it says that it expected 2 variables
item.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, me(fire));
and...
private function me(event:ContextMenuEvent, fire:Number):void {
so, i try this one
item.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, me(ContextMenuEvent, fire));
and...
private function me(event:ContextMenuEvent, fire:Number):void {
but is says “Type Coercion failed: cannot convert flash.events::ContextMenuEvent$ to flash.events.ContextMenuEvent.”
I dont know what else to try. Can somebody please help me?
Thanx