FORUMS: list search recent posts

comboBox results

COW Forums : Adobe Flash

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Olu Bukola
comboBox results
on Apr 20, 2008 at 12:17:25 am

Hi, can anyone help with suggested code to produce text results when choices are made from several comboBoxes.

My code looks like this at the moment.

createClassObject(mx.controls.ComboBox, "price_cb", 10);

price_cb._x = 300;
price_cb._y = 200;

price_cb.addItem({data:1, label:""});
price_cb.addItem({data:2, label:"£60 - £80"});
price_cb.addItem({data:3, label:"£80 - £100"});
price_cb.addItem({data:4, label:"100+"});

//Now add an event listener and event handler function to respond
//when a ComboBox item is selected:
// Create listener object.
var cbListener:Object = new Object();
// Create event handler function.
cbListener.change = function (evt_obj:Object) {
trace("Currently selected item is: " + evt_obj.target.selectedItem.label);
}
// Add event listener.
price_cb.addEventListener("change", cbListener);


createClassObject(mx.controls.ComboBox, "ensuite_cb", 20);

ensuite_cb._x = 300;
ensuite_cb._y = 250;

ensuite_cb.addItem({data:1, label:"No1"});
ensuite_cb.addItem({data:2, label:"Yes"});

// Create listener object.
var cbListener:Object = new Object();
// Create event handler function.
cbListener.change = function (evt_obj:Object) {
trace("Currently selected item is: " + evt_obj.target.selectedItem.label);
}
// Add event listener.
ensuite_cb.addEventListener("change", cbListener);

I basically want a name to appear if certain choices are chosen.

Thanks in advance


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 CreativeCOW.net All Rights Reserved
[TOP]