PDA

View Full Version : ComboBoxes VS Dynamic Text


oceanmx13
09-02-2004, 08:04 PM
So I just made the jump to MX2004 and before this point I have no really spent much time with Components...infact non at all.

Now I'm in the midst of a project where I'm trying to use ComboBoxes and have them dynamically load text into a text field. Pretty simple stuff. I don't need XML or php just a simple "if then statement".

Can someone please hook me up with some code or an example I can rip apart a look at cause this is killing me. Thanks.

Ocean

deQue
09-04-2004, 12:27 PM
Your code will something like this:
var myCombo = _root.statusComboBox;
statusComboBoxListener = new Object();
statusComboBoxListener.change = function(eventObj) {
var myStatus = _root.messageArea.statusBar;
var curLabel = eventObj.target.label;
var curData = eventObj.target.data;
myStatus.text = "Current selection of "+eventObj.target+" is "+curLabel+", which has the data value of "+curData;
}
myCombo.addEventListener("change", statusComboBoxListener);

oceanmx13
09-07-2004, 04:38 PM
BOMBER! Thats the sweet action I was looking for thanks mate.

ocean