Adding Links in Menu in Adobe AIR/ FLEX.

By | March 29, 2012

Hi all…

In this tutorial I will show you how to add links in a menu in Adobe AIR/ FLEX.
It is really simple. Just add a normal menu item and on the click handler for menu items match the label and navigate to the URL, that’s all.
Check out this example.
Change the mx:Application to mx:windowedApplication to work this example as AIR application.



	
		
					
						
						
					
					
						
					
				;

			// create menu items
			private function init():void {
				menuCollection = new XMLListCollection(menubarXML);
			}

			// click handler for menubar
			private function menuHandler(event:MenuEvent):void
			 {
				if(event.item.@label=="Google.com")
				{
					var url:URLRequest = new URLRequest('http://www.google.com');
					navigateToURL(url,'_parent');
				}
				else if(event.item.@label=="Yahoo.com")
				{
					url = new URLRequest('http://www.yahoo.com');
					navigateToURL(url,'_parent');
				}
			}
		]]>
	
	
	
	

Link in menu example in Adobe AIR

One thought on “Adding Links in Menu in Adobe AIR/ FLEX.

  1. Wedding Menu Ideas = Food Ideas for an Unforgettable Wedding

    You’ve got great insights about menus, keep up the good work!

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *