2 Replies Latest reply on Sep 9, 2010 6:24 AM by h_c

    opening a page in a browser when a choice is selected from the Menu

    h_c Level 1

      The choice item is defined in MXML as

       

      <menuitem label="Help">
                      <menuitem label="Documentation" data="documentation.swf" />
                  </menuitem>

       


      Code on what to do when it is selected is

       

      <mx:ApplicationControlBar id="appBar" x="0" y="0" dock="false" visible="false" width="100%">
              <mx:MenuBar id="appNavigation" dataProvider="{appNavigation_dp}" labelField="@label" iconField="@icon" itemClick="menuBarButtons(event);" />
         
          </mx:ApplicationControlBar>

       

      Function called menuBarButtons is

       

      private function menuBarButtons(event:MenuEvent):void{
                      var pageName:String = event.item.@data;
                     
                      switch(pageName){

       

      case 'Documentation':
                          var url:URLRequest = new URLRequest('http://www.mydocumentation.com');  
                              navigateToURL(url,'_blank');

       


                          break;

       

      }

       

      I have done the required imports such as

       

      import flash.net.navigateToURL;
                  import flash.net.URLRequest;
                  import flash.net.URLVariables;

       

       

       

      When I click on the Documentation option from the menu, no new URL opens
      while I am expecting a page with a URL http://www.mydocumentation.com to be
      opened

       

      What am I missing?

       

      Any suggestions would be appreciated.