| Home | Tutorials | Forums | Articles | Blogs | Movies | Library | Employment | Press | Buy templates |
|
|
#1 |
|
Registered User
Join Date: Sep 2002
Location: Perth, Western Australia
Posts: 4
|
I'm working on a project that requires contact details to be listed for different clubs. I thought the best way to do this was to have the club names in a combo box, which can be selected, then the contact details for that club could then be loaded with loadVariables command via a txt file.
I've tried many different code variations, and nothing is working yet. Can anyone help on this. This is what I have so far is function onSelect1() { onSelect1 = combobox.getSelectedItem().label; if (onSelect1 == "clubA") { loadVariablesNum("clubA.txt", 1); } else if (onSelect1 == "clubB") { loadVariablesNum("clubB.txt", 1); } } The dynamic text field has been set as multiline (without wrap), the variable name is myContact. The handler on the combo box is called onSelect1 Does it matter that multiple txt files can be loaded into the same text field with the same variable name? |
|
|
|
|
|
#2 |
|
done
Join Date: Jun 2001
Location: portland, or
Posts: 8,048
|
welcome to as[org]. please remember to search.
i posted this earlier today: http://www.actionscripts.org/forums/...threadid=16389 just put your load actions inside the changehandler where i have the trace statements.
__________________
tg --- what the hell was i thinking? |
|
|
|
|
|
|
|
|
#3 |
|
Registered User
Join Date: Sep 2002
Location: Perth, Western Australia
Posts: 4
|
I did read that post but couldn't get it to work. I obviously haven't got it right now either. The script I have now is corrupt and is followed.
club_select.setChangeHandler=function("getPick"); function getPick(club_select){ trace(club_select.getSelectedItem().label; trace(club_select.getSelectedItem().data; if (onSelect1 == "Coolbinia-West Perth") { loadVariablesNum("coolbinia.txt", 1); } else if (onSelect1 == "Ascot") { loadVariablesNum("ascot.txt", 1); } } Can someone tell me whats wrong |
|
|
|
|
|
#4 |
|
done
Join Date: Jun 2001
Location: portland, or
Posts: 8,048
|
ActionScript Code:
don't know if your check the label or data of the combobox, so you may need to change this code to reflect the correct choice.
__________________
tg --- what the hell was i thinking? |
|
|
|
|
|
#5 |
|
Registered User
Join Date: Sep 2002
Location: Perth, Western Australia
Posts: 4
|
i've tried this and no good either.
If someone could set up a simple example of how this works and post the fla in a zip. I may be able to understand what has to happen in my example. I am totally confused. Too much new code that I don't fully understand. Hope someone can help. |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|