I have 4 combobox
var solvent:Array = ["Select one", {data:"etanol", label:"Etanol"}, {data:"heksana", label:"Heksana"}, {data:"etilasetat", label:"Etilasetat"}];
var ratio:Array = ["Select one", {data:"2", label:"1:2"}, {data:"3", label:"1:3"}, {data:"4", label:"1:4"}];
var temperature:Array = ["Select one", {data:"25", label:"25° C"}, {data:"40", label:"40° C"}, {data:"100", label:"100° C"}];
var time:Array = ["Select one", {data:"8", label:"8 Hours"}, {data:"12", label:"12 Hours"}, {data:"24", label:"24 Hours"}];
and I want to add listener so the four of them can interact and get the result when I press result button like this
var boxValue:Object = new Object();
boxValue.change = function (ValueObject)
{
solventBoxValue = solventBox.selectedItem().data;
ratioBoxValue = ratioBox.selectedItem().data;
temperatureBoxValue = temperatureBox.selectedItem().data;
timeBoxValue = timeBox.selectedItem().data;
checkValue();
};
function checkValue()
{
userChoice = solventBoxValue+ratioBoxValue+temperatureBoxValue+timeBoxValue;
trace (userChoice);
switch (userChoice)
{
case "etanol2258" :
trace("9.3");
break;
case "etanol22512" :
trace("12.9");
break;
case "etanol22524" :
trace("13.5");
break;
etc-etc
default :
trace("no combination found");
break;
}
}
Button_Result.onRelease = function()
{
checkValue();
}
but, the result is always the default “no combination found”
Please, help.