Home Tutorials Forums Articles Blogs Movies Library Employment Press Buy templates

Go Back   ActionScript.org Forums > Extensions and Plugins > Components

Reply
 
Thread Tools Rating: Thread Rating: 2 votes, 5.00 average. Display Modes
Old 09-25-2002, 04:26 PM   #1
bibbs
Registered User
 
Join Date: Sep 2002
Location: Perth, Western Australia
Posts: 4
Default combox box - load variable

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?
bibbs is offline   Reply With Quote
Old 09-25-2002, 04:41 PM   #2
tg
done
 
Join Date: Jun 2001
Location: portland, or
Posts: 8,048
Default

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?
tg is offline   Reply With Quote
Old 09-25-2002, 05:00 PM   #3
bibbs
Registered User
 
Join Date: Sep 2002
Location: Perth, Western Australia
Posts: 4
Default

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
bibbs is offline   Reply With Quote
Old 09-25-2002, 05:32 PM   #4
tg
done
 
Join Date: Jun 2001
Location: portland, or
Posts: 8,048
Default

ActionScript Code:
if (club_select.getSelectedItem().label == "Coolbinia-West Perth") { loadVariablesNum("coolbinia.txt", 1); } else if (club_select.getSelectedItem().label == "Ascot") { loadVariablesNum("ascot.txt", 1);

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?
tg is offline   Reply With Quote
Old 09-25-2002, 05:51 PM   #5
bibbs
Registered User
 
Join Date: Sep 2002
Location: Perth, Western Australia
Posts: 4
Default

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.
bibbs is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT. The time now is 07:50 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2009 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.
You Rated this Thread: