> I have a menu bar component > > <mx:MenuBar id="mainMenu" labelField="@label" > click="{MenuEvent(event)}" > itemClick="{MenuItemEvent(event)}"> > > Everytime I create a handler like this: > > private function MenuItemEvent(e:MenuEvent):void > > I get a "Type was not found or was not a compile-time constant: MenuEvent" > > But, I've explicitly imported this event: > > import mx.events.MenuEvent; > > Am I going mad? What am I doing wrong? I'm using standalone Flex Builder > 3.0.2.214193 on Windows XP- not the Eclipse plug-in.
You appear to also have an event handler called MenuEvent assigned to the click handler of the MenuBar. Also, you don't need bindings for event handler values. You only need bindings to use AS expressions in non-event attributes of MXML elements. Finally, it's arguably bad form to name things other than classes in title case - the convention is to use camel case for variables and functions. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ http://training.figleaf.com/ Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on GSA Schedule, and provides the highest caliber vendor-authorized instruction at our training centers, online, or onsite. _______________________________________________ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders