PDA

View Full Version : Error Message: parameter 'event' has no type declaration


shizny
03-06-2008, 05:39 PM
Here is an easy one for somebody. Why am I getting this error

Error Message: parameter 'event' has no type declaration

When I have typed the Event?

My code:


private function createAndShow():void {
//call notification ? JJM
var myMenu:Menu = Menu.createMenu(null, myMenuData, false);
myMenu.labelField="@label";
myMenu.show(10, 50);
myMenu.addEventListener(MenuEvent.ITEM_CLICK, menuHandler);
}

private function menuHandler(event:MenuEvent):void {
trace("Calling the dispatchEvent: "+event.item.@id);
//event.item.@enabled = false;
dispatchEvent( new Event( event.item.@id ) );
}

FlashBulb
03-06-2008, 07:09 PM
Did you remember to put

import mx.events.MenuEvent;

at the top?

shizny
03-06-2008, 07:46 PM
yep, I saw that last night, changed it and still no dice.

dr_zeus
03-11-2008, 05:58 PM
Are you certain that the error is somewhere in the code you posted, or could it be somewhere else?