4 Replies Latest reply on Aug 3, 2006 12:51 AM by Techauth

    Forms

    Techauth
      Hi all,

      I have been searching the forum for a while now and found quite a few posts regarding combo boxes. I have tried a few thing which I have found however cannot get any to work correctly. I have 4 combo boxes labelled:
      - combo1
      - combo2
      - combo3
      - combo4

      They are all on the same layer and frame. I want to populate them using the following script which I know will work however the way I am trying to get it to work is the user will only be able to select from the first combo1, as soon as they have selected an option combo2 will activate and the user can select an option from this list. Once combo2 option has been selected combo3 becomes active and so on.

      All I need is a global variable to store each value as and when the get selected, once the combo4 has been selected the user will be sent to another frame. I hope this make sense and that someone will be able to help.

      Thanks for your time and help.
        • 1. Re: Forms
          Nimi_M
          you can use combobox.enabled=true/false to enable/disable combo boxes.
          Eg - combo2.enabled = false will disable combo2

          You can add event listeners (ComboBox.change maybe) and enable and disable which ever combo box you need.
          • 2. Re: Forms
            Techauth Level 1
            Nimi_M,

            I have tried using the enabled.true/false and it does work to some degree, I have also used the event listener however I cannot get it working on the same frame. An example of what I am trying to do, is on frame 1 I have the 4 combo boxes 3 are disabled from the start. User selects and option from combo1 and combo2 becomes enabled etc.
            • 3. Re: Forms
              Nimi_M Level 1
              try this code
              combo2.enabled = false;
              combo3.enabled = false;
              combo4.enabled = false;
              // Create Listener Object.
              var cbListener:Object = new Object();
              // Assign function to Listener Object.
              cbListener.change = function(event_obj:Object) {
              switch (event_obj.target._name) {
              case "combo1" :
              combo1.enabled = false;
              combo2.enabled = true;
              combo3.enabled = false;
              combo4.enabled = false;
              break;
              case "combo2" :
              combo1.enabled = false;
              combo2.enabled = false;
              combo3.enabled = true;
              combo4.enabled = false;
              break;
              case "combo3" :
              combo1.enabled = false;
              combo2.enabled = false;
              combo3.enabled = false;
              combo4.enabled = true;
              break;
              }
              };
              // Add Listener.
              combo1.addEventListener("change", cbListener);
              combo2.addEventListener("change", cbListener);
              combo3.addEventListener("change", cbListener);
              combo4.addEventListener("change", cbListener);
              • 4. Re: Forms
                Techauth Level 1
                Thanks for your help it works fine.