1 Reply Latest reply on Dec 3, 2010 3:34 PM by John Hall

    Passing variable from combobox to variable

    Enigma006 Level 1

      Hai

       

      I am new to flex. Can someone help me on this?

       

      I have some comboboxes, list boxes etc on the page. I am able to get the selected item in the combo box.

      I ma facing problem at storing this in a variable and passing it in a URL as a parameter. Can some one help me on this?

      I need to pass the variable which will have that combobox's selected item in that url1.

       

      Here is sample code

       

       

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" minWidth="955" minHeight="600">
         
          <mx:Script>
              <![CDATA[
                  import flash.net.navigateToURL;
                 
                  private function open(url:String):void
                  {
                      var url1:URLRequest = new URLRequest("http://localhost:8081/Servlet?ex=jh.jsp");
                      navigateToURL(url1);
                  }               
          ]]>
          </mx:Script>
         
          <mx:ControlBar horizontalAlign = 'center' x="10" y="107">
              <mx:Text text = '{combo1.selectedItem}'  fontSize="14" color="#EFF3B0"/>
          </mx:ControlBar>
         
          <mx:Button label="Run a fex" click="open(url)"  x="10" y="234"/>
          <mx:ComboBox x="10" y="56" id="combo1">
              <mx:ArrayCollection>
                  <mx:String>AK</mx:String>
                  <mx:String>AL</mx:String>
                  <mx:String>AR</mx:String>
              </mx:ArrayCollection>
          </mx:ComboBox
      </mx:Application>

       

       

       

       

       

       

       

       

       

      Thanks a lot..