<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-7037739742719600461</id><updated>2024-09-14T05:42:59.222-07:00</updated><title type='text'>Flex</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://flex-spring.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7037739742719600461/posts/default'/><link rel='alternate' type='text/html' href='http://flex-spring.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Krishna</name><uri>http://www.blogger.com/profile/11406265137356934399</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>1</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7037739742719600461.post-7398164454509720663</id><published>2009-09-23T07:11:00.000-07:00</published><updated>2009-09-24T08:43:04.068-07:00</updated><title type='text'>Flex menu - menu items from XML file</title><content type='html'>There are lot of flex menu samples in the net but most are based on the&lt;br /&gt;
&amp;lt;mx:xml&amp;gt; or the arraycollections. In this example the menu item is&lt;br /&gt;
populated from external xml file.Here is the mxml file in which menu is added. &lt;br /&gt;
&lt;pre style=&quot;color: black; font-family: courier new; font-size: 10pt; line-height: normal;&quot;&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style=&quot;color: black; font-family: courier new; font-size: 10pt; line-height: normal;&quot;&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&amp;gt;
&amp;lt;mx:Application&amp;nbsp;&lt;/pre&gt;&lt;pre style=&quot;color: black; font-family: courier new; font-size: 10pt; line-height: normal;&quot;&gt;xmlns:mx=&quot;http://www.adobe.com/2006/mxml&quot; 
applicationComplete=&quot;xmlDataList.send()&quot;&amp;gt;
&amp;lt;mx:Script&amp;gt;
 &amp;lt;![CDATA[

   import mx.events.MenuEvent;
   import mx.controls.Alert;
   import mx.collections.*;
   import mx.rpc.events.ResultEvent;

[Bindable]
private var menuBarItems:XMLList;&lt;/pre&gt;&lt;pre style=&quot;color: black; font-family: courier new; font-size: 10pt; line-height: normal;&quot;&gt;private function resultHandler(event:ResultEvent):void
      {
   var result:XML = event.result as XML;
       menuBarItems = result.menuitem as XMLList;
      }

 ]]&amp;gt;
&amp;lt;/mx:Script&amp;gt;
&amp;lt;mx:HTTPService id=&quot;xmlDataList&quot; url=&quot;menuBarList.xml&quot;&lt;/pre&gt;&lt;pre style=&quot;color: black; font-family: courier new; font-size: 10pt; line-height: normal;&quot;&gt;result=&quot;resultHandler(event)&quot; 
resultFormat=&quot;e4x&quot;/&amp;gt;
&amp;lt;mx:HBox  height=&quot;55&quot; width=&quot;100%&quot; &amp;gt;
&amp;lt;mx:HBox  height=&quot;20&quot;&amp;gt;
&amp;lt;mx:MenuBar labelField=&quot;@label&quot;&amp;nbsp;&lt;/pre&gt;&lt;pre style=&quot;color: black; font-family: courier new; font-size: 10pt; line-height: normal;&quot;&gt;change=&quot;menuHandler(event);&quot; 
 dataProvider=&quot;{menuBarItems}&quot;/&amp;gt;  
    &amp;lt;/mx:HBox&amp;gt;
&amp;lt;/mx:HBox&amp;gt;
&amp;lt;/mx:Application&amp;gt;&lt;/pre&gt;&lt;pre style=&quot;color: black; font-family: courier new; font-size: 10pt; line-height: normal;&quot;&gt;&lt;/pre&gt;&lt;pre style=&quot;color: black; font-family: courier new; font-size: 10pt; line-height: normal;&quot;&gt;Given below is the content of menuBarList.xml&lt;/pre&gt;&lt;pre style=&quot;color: black; font-family: courier new; font-size: 10pt; line-height: normal;&quot;&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style=&quot;color: black; font-family: courier new; font-size: 10pt; line-height: normal;&quot;&gt;&amp;lt;menu&amp;gt;
&amp;lt;menuitem label=&quot;FILE&quot; data=&quot;top&quot;&amp;gt;
&amp;lt;menuitem label=&quot;New&quot; data=&quot;#&quot;/&amp;gt;
&amp;lt;menuitem label=&quot;Open&quot; data=&quot;#&quot;/&amp;gt;
&amp;lt;/menuitem&amp;gt;
&amp;lt;menuitem label=&quot;Edit&quot; data=&quot;top&quot;&amp;gt;
&amp;lt;menuitem label=&quot;Copy&quot; data=&quot;#&quot;/&amp;gt;
&amp;lt;menuitem label=&quot;Cut&quot; data=&quot;#&quot;/&amp;gt;
&amp;lt;/menuitem&amp;gt;
&amp;lt;menuitem label=&quot;View&quot; data=&quot;top&quot;&amp;gt;
&amp;lt;menuitem label=&quot;Page Source&quot; data=&quot;#&quot;/&amp;gt;
&amp;lt;menuitem label=&quot;Full Screen&quot; data=&quot;#&quot;/&amp;gt;
&amp;lt;/menuitem&amp;gt;
&amp;lt;menuitem label=&quot;Help&quot; data=&quot;top&quot;&amp;gt;
&amp;lt;menuitem label=&quot;Version&quot; data=&quot;#&quot;/&amp;gt;
&amp;lt;menuitem label=&quot;Help content&quot; data=&quot;#&quot;/&amp;gt;
&amp;lt;/menuitem&amp;gt;
&amp;lt;/menu&amp;gt;&lt;/pre&gt;&lt;pre style=&quot;color: black; font-family: courier new; font-size: 10pt; line-height: normal;&quot;&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style=&quot;color: black; font-family: courier new; font-size: 10pt; line-height: normal;&quot;&gt;&lt;/pre&gt;&lt;pre style=&quot;color: black; font-family: courier new; font-size: 10pt; line-height: normal;&quot;&gt;Please feel free to email/post your doubts&lt;/pre&gt;&lt;pre style=&quot;color: black; font-family: courier new; font-size: 10pt; line-height: normal;&quot;&gt;&lt;/pre&gt;&lt;pre style=&quot;color: black; font-family: courier new; font-size: 10pt; line-height: normal;&quot;&gt;Enjoy 
&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://flex-spring.blogspot.com/feeds/7398164454509720663/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://flex-spring.blogspot.com/2009/09/flex-menu-menu-items-from-xml-file.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7037739742719600461/posts/default/7398164454509720663'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7037739742719600461/posts/default/7398164454509720663'/><link rel='alternate' type='text/html' href='http://flex-spring.blogspot.com/2009/09/flex-menu-menu-items-from-xml-file.html' title='Flex menu - menu items from XML file'/><author><name>Krishna</name><uri>http://www.blogger.com/profile/11406265137356934399</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>