PDA

View Full Version : help with a combo box??


mudos
06-08-2002, 11:51 PM
ok here is my problem....i got a e_commerce site that is done...yet....ofcourse... there is one problem...combo box...i have a combo box that adds prices to a shopping cart...is there a way for this same combo box to add the label information along with the data. here is a file of what im doing...please help.

leblob
06-09-2002, 01:41 PM
you might use the getSelectedItem() method of the combobox object.

from the actionscript dictionnary :

Description


Method; returns the currently selected item as an object with the properties label and data, or returns undefined if no item is selected.

Example

The following code retrieves the label and data of the item currently selected in comboBox1.

trace(comboBox1.getSelectedItem());

The following code retrieves the label of the item currently selected in comboBox2.

trace(comboBox2.getSelectedItem().label);

The following code retrieves the data of the item currently selected in comboBox3.

trace(comboBox3.getSelectedItem().data);


is that what you're looking for?

Abelius
06-09-2002, 02:06 PM
myComboBox.getSelectedItem().label += myAdditonalInformation;

mudos
06-09-2002, 06:11 PM
you guys saved my ass.....thanks to both... and thanks for giving me my first actionscript.org victory. i learned alot from this.