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

Website Pin Facebook Twitter Myspace Friendfeed Technorati del.icio.us Digg Google StumbleUpon Premium Responsive

Leave a Reply

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