Tuesday, 15 May 2012

actionscript 3 - Flash Combo Box... set the text field to selected value? -


Hey everyone .. I'm really new to flash. I have a combo box and I am using it 'default index' property so that it can be given a default value (a value that is at first (0) index). Setting this property in my action script selects the value in the dropdown but it does not add the selected value to the text field of the combo box. how do you do this? None of my selection has any effect on the text field.

Here is a sample of my code. The combo box list is properly populated and the price is selected in the list. However, once you select the value in the list, the list of combo box closes and nothing remains in the text field of the combo box.

  comboBoxData.insert (0, {data: 1, label: "Show me something specific"}); For (I'm In Animation) {comboBoxData.push ({Data: i.uri, label: "somevalue"}); } ComboBox.dataProvider = comboBoxData; ComboBox.selectedIndex = 0; ComboBox.text = comboBox.selectedIndex; This._lockroot = true;  

My solution is using AS2.

Thank you!

- Nick

I think you need to add some code. I do not really understand whether you have a text field and a Cambodia? If this is the case, you can do something to give selected indexes in the text field

  combo_cmb.selectedIndex = 1; Text_txt.text = c.selectedIndex; Var Listener ObjectPM: object = new object (); ListenerObjectPM.change = function (Event Object: Object) {text_txt.text = combo_cmb.selectedIndex; } Combo_cmb.addEventListener ("Change", Source Listener PM);  

If you want to print the labels in the text area, then you text_txt.text = combo_cmd.selectedItem.label; You can change the value of or print the data if you want it to be text_txt.text = combo_cmb.selectedItem.data; Change to . If not, you can write code, so I can better understand what you are trying to do.


No comments:

Post a Comment