Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ComboBox Help Needed 1

Status
Not open for further replies.

nccmbc

Technical User
Apr 26, 2007
2
CA
Hi Everyone,

I'm a total newbie, but I need to get the following comboBox tutorial working for Flash 8. I'm learning, but I need this working asap.


Looks easy enough, except this paragraph is totally throughing me:

"The changeHandler parameter determines what function is called when the selected value of the "main_cb" comboBox has changed. We'll set this to "setSubCombo"."

Please Help!
 
when the user makes a selection from the combo box the function setSubCombo is called to determine what action ought to be taken

from a quick look at the tutorial the action is with what values a second combo box will be populated
 
I've got the two comboboxes working, but now I'm having trouble getting the user selection to go to the corresponding frame in the timeline. I'm completely clueless when it comes to this, but I just need this bit of code to work. Cheers!

stop();
//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;
setSubCombo(subArray);
};
main_cb.addEventListener("change", myComboBoxListener);

//Place Sub-Topics Here:
//CLEAN SAMPLES
cleanArray = new Array("Please Select Your Application...", "Ultrapure Water", "Drinking Water", "River / Lake / Ground Water", "Sea Water", "Treated Raw Water");
//RAW WASTEWATER
rawArray = new Array("Please Select Your Application...", "Municipal Sewage Collection", "Power Generating Stations", "Tar Sands Produced Water", "Oil Refineries");
//Manufacturing
manufArray = new Array("Please Select Your Application...", "Food & Beverage Manufacturing", "Agricultural Water", "Pulp & Paper Process Water", "Specialty Chemical Manufacturing", "Metallurgical Manufacturing", "Semiconductor Manufacturing");
//WASTEWATER TREATMENT
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");
//INDUSTRIAL WATER
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];
sub_cb.removeAll();
for (var i = 0; i<whichArr.length; i++) {
sub_cb.addItem(whichArr, whichArr);
}
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top