webhound
11-01-2007, 04:09 PM
Hi hope someone can help me here!
I have a series of comboBox's each containing a data value ranging from 1-10 and other ranging from -10 to 10. When the user makes a selection from each comboBox it adds the value to a dynamic text field (through a listener).
The problem im having is, if the user starts in any order other than starting from the 1st comboBox (_root.cb8), it doesnt add the values correctly becuase i have this code:
mTotal = _root.cb8.selectedItem.data + _root.cb9.selectedItem.data + _root.cb10.selectedItem.data + _root.cb11.selectedItem.data + _root.cb12.selectedItem.data + _root.cb13.selectedItem.data + _root.cb14.selectedItem.data;
The question is, how do i get it to add the values correctly no matter what order the user makes a selection from?
Thanks in advance
I have a series of comboBox's each containing a data value ranging from 1-10 and other ranging from -10 to 10. When the user makes a selection from each comboBox it adds the value to a dynamic text field (through a listener).
The problem im having is, if the user starts in any order other than starting from the 1st comboBox (_root.cb8), it doesnt add the values correctly becuase i have this code:
mTotal = _root.cb8.selectedItem.data + _root.cb9.selectedItem.data + _root.cb10.selectedItem.data + _root.cb11.selectedItem.data + _root.cb12.selectedItem.data + _root.cb13.selectedItem.data + _root.cb14.selectedItem.data;
The question is, how do i get it to add the values correctly no matter what order the user makes a selection from?
Thanks in advance