0 Replies Latest reply on Apr 27, 2007 9:20 AM by NcCMbC

    Dependable ComboBox Listener

    NcCMbC Level 1
      Hi everyone,

      I have a bit of code which provides two combobox's. Now I need to get it to do something. When a user selects the an option in sub_cb, it needs to go to the corresponding frame. How do I do this? I'm a complete novice when it comes to Flash and I've struggling with this for over week - I just need this last bit of code to work and I can go back to designing. Many thanks if you help me out with this, cheers!

      //Place Main Topics Here:
      mainArrLabel = ["Please Select a Category...", "Clean Samples", "Raw Wastewater", "Manufacturing", "Wastewater Treatment", "Industrial Water", "Unique Samples"];
      mainArrData = ["", "cleanArray", "rawArray", "manufArray", "wasteArray", "industrialArray", "uniqueArray"];
      for (var j = 0; j<mainArrLabel.length; j++) {
      main_cb.addItem(mainArrLabel[j], mainArrData[j]);
      myComboBoxListener = new Object();
      myComboBoxListener.change = function(eventObj) {
      var eventSource = eventObj.target;
      var theSelectedItem = eventSource.selectedItem;
      var theSelectedItemLabel = theSelectedItem.label;
      var theSelectedItemValue = theSelectedItem.data;
      var subArray = theSelectedItemValue;
      main_cb.addEventListener("change", myComboBoxListener);

      //Place Sub-Topics Here:
      cleanArray = new Array("Please Select Your Application...", "Ultrapure Water", "Drinking Water", "River / Lake / Ground Water", "Sea Water", "Treated Raw Water");
      rawArray = new Array("Please Select Your Application...", "Municipal Sewage Collection", "Power Generating Stations", "Tar Sands Produced Water", "Oil Refineries");
      manufArray = new Array("Please Select Your Application...", "Food & Beverage Manufacturing", "Agricultural Water", "Pulp & Paper Process Water", "Specialty Chemical Manufacturing", "Metallurgical Manufacturing", "Semiconductor Manufacturing");
      wasteArray = new Array("Please Select Your Application...", "Aerobic / Activated Sludge", "Anoxic Bioreactors", "Anaerobic Sludge Reactors & Fermentors", "Trickling Filter Bioreactor", "High-Rate Activated Sludge", "Return / Waste Activated Sludge", "Biological Nutrient Removal", "Membrane Bioreactors", "Sequencing Batch Reactors", "Wastewater Treatment Effluent");
      industrialArray = new Array("Please Select Your Application...", "Pulp Samples", "Cooling Tower Makeup / Process Water");
      //UNIQUE SAMPLES / Product Testing
      uniqueArray = new Array("Please Select Your Application...", "Paper Manufacturing Process Deposits", "Water Treatment System Deposits", "Waste Biosolids", "Chemical Emulsion Products", "Wastewater Treatment Bioreactor Foam Samples", "Soil", "Glue");
      function setSubCombo(arr) {
      whichArr = this[arr];
      for (var i = 0; i<whichArr.length; i++) {
      sub_cb.addItem(whichArr , whichArr);
      var myListener:Object = new Object();
      sub_cb.addEventListener("change", myListener);
      myListener.change = function() {