Tuesday, February 1, 2011

How to use Menu Bar in Flex

In this chapter we will discuss about flex programming language. I will show you how to make menu bar and access menu. In flex programming language there have a hierarchy(MenuBar->XMListCollection->XMLList->MenuItem). First open your IDE in this case i will use eclipse europa with flex builder plug in. Please copy code bellow in your flex project.

































At code above is example to make menu bar in flex but at menu not have a action to do something so we must add some script. In this case I will click menu 1-1 and will display with message error "Menu 1-1".Please copy code bellow:





import mx.controls.Alert;
import mx.events.MenuEvent;
private function listenerMenu(event:MenuEvent):void {
Alert.show(event.item.@label,"Warning");
}
]]>




























Result


Okat that's is it and finnaly congratulation you have make one component in flex.Thank you for see this tutorial i hope with this tutorial can help you.^^

No comments:

Post a Comment