|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
problems with setChangeHandler() for comboBox in MX
I need to populate a dynamic text field with the data property of the selected item in the comboBox component which is an alphebetical list of US states, with the data values being those states' two letter abbreviations. The code is in an included .as file. Everything else in the movie works just fine. Here's the code:
_root.mcFields.stateSelector._visible=false; function fillState(){ _root.mcFields.stateSelector.getSelectedItem().data; _root.mcFields.stateSelector._visible=false; } _root.mcFields.stateSelector.setChangeHandler("fillState"); _root.mcFields.dtfState.onSetFocus=function(){ _root.mcFields.stateSelector._visible=true; } Is this right? |
|
#2
|
|||
|
|||
|
What is it you want to do with the state put it in a text field right.
Code:
function fillState(what){
_root.textfieldInstance.text = what.getSelectedItem().data;
what._visible=false;
}
|
|
#3
|
|||
|
|||
|
yes. that is it exactly. thank you. But what is the syntax for setting the comboBox change handler to said function if it is nested in a movie clip?
|
|
#4
|
|||
|
|||
|
If whats nested in a movie clip the function fillState()
As long as its in the same movie clip as the combobox, its fine, I would suggest putting the function in the main timeline. setChangeHandler takes a second optional parameter which points to the location of the function if its not in the same movie clip. So if the function was in a mc named myMc off the root level. Code:
_root.mcFields.stateSelector.setChangeHandler("fillState", _root.myMc);
Notice there is no quotes around it. |
|
#5
|
|||
|
|||
|
You've been most helpful. Thank you very much. It's good to know that there are indeed other flash users out there. I live in buckeye, arizona, which if you know nothing about it, is just about as far away from a programmer haven as anything can be. I just can't seem to find anyone else that knows flash! Thanks again, man!
|
![]() |
| Viewing: Dev Shed Forums > Web Design > Flash Help > problems with setChangeHandler() for comboBox in MX |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|