View Full Version : onSelect change Focus (comboBox)

04-04-2003, 10:17 AM
Hi All,

I have a problem here with changing the focus from the combobox to a text feild.

I have a FcombBox component with 10 items, and a text feild below the comboBox which get teh selected Item from the combBox. All I want to do is change the focus to the text feild after an item is selected.

//code: --------------------------------

function setFocus(){
mytext.text = _root.list.getSelectedItem().label;

// end of code--------------------------------------

When I do this, the focus does change to the textfeild but it leaves the comboBox open. it Does not goback to the closed state. How do I make the combobox close and then set teh focus to the textFeild.

Please help!!

04-06-2003, 12:22 AM
Try calling the combo box's onKillFocus() function. See what that does for you. If that doesn't work, I would suggest going through the combo box code and finding a reference to killFocus (just do a quick FIND) and seeing how such an action is called internally within the component. You should be able to work backwards and find what you need.

Oh, you might also try:

_root.list.setSelectedIndex(_root.list.getSelected Index());

THat might automatically close it.

04-08-2003, 11:51 AM

I could not figure out code in the component, but I did try the option of resetting the index but it did not work. When the below code

_root.list.setSelectedIndex(_root.list.getSelected Index());

is used it goes into an infinite loop and Flash show an error.

Can someone pls help me solve this problem.