Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Combo Box Issues

Status
Not open for further replies.

Sdirby

Technical User
Mar 8, 2004
18
US
Good Afternoon everyone,

I'm making a phone directory in flash for my department in our company. Even though using the asp to pull data from a text file would be great, but i'm not that good yet and i dont want to just copy a tutorial. So what i'm doing is, i would like to input all of the employees into a combo box, and once their name has been selected i would like for it to go to a specific frame in the movie. For instance, If i select employee 4, i want the movie to go to frame 5. I havent seen any tutorials or articles explaining this, although it's highly probable i've missed it somewhere. I'm just starting to get into actionscript, so a detailed explanation would help very much. Thank you for taking time out of your day to help me!
Thank you!
 
you could put in simple change handler to find out what is selected and the send it to the appropiate frame

//phonelist is instance name of combo box
phonelist.setChangeHandler("selectEmployee");

function selectEmployee(component){
//each employee has number which is their frame no. on the movie.
var frameNo = phonelist.getSelectedItem().data;
gotoAndStop(frameNo)
}

this is a very simple solution to your problem, i hope it helps
 
Thanks, but it keeps giving me a syntax error and saying


"Scene=Scene 1, Layer=Text, Frame=1: Line 11: Statement must appear within on/onClipEvent handler
phonelist.setChangeHandler("selectEmployee");

Scene=Scene 1, Layer=Text, Frame=1: Line 13: Statement must appear within on/onClipEvent handler
function selectEmployee(component){"

Like i said, i'm VERY new to actionscript and am trying to learn but i'm stuck in my MS access mode and it's hard for me to switch. lol. If you could give me a hand, again i'd be truly greatful. I kind of understand but not quite.
Thanks!

 
Rather than first trying to set the changeHandler with actionscript, as Womblies suggested, start by simply typing in the Change Handler parameter line (in the combo's properties), selectEmployee, no ().
Remove the lines...
//phonelist is instance name of combo box
phonelist.setChangeHandler("selectEmployee");

But leave the function's definition...
 
I'll give this a try and see how it goes... Also, could you point me in the direction of any Really good Beginner Actionscript tutorials/books. Thanks, i'll try this and let you know.
 
Thank you guys so much, I so happy that you volunteer your time to help us out. You all are a blessing and i wish there were more people out there like you. And please, if you could at least post anywhere that would have good actionscript tutorials other than flashkit. Thanks.
 
Thanks, but i'm having one more problem. Sometimes when i click a name in the combo box, it's supposed to go to the frame with the data, but instead it just goes back to the beginning, or blank. Any ideas as to why? It's like after every selection i make it wants to go back to the beginning. Should i put a stop() in every frame?



 
You should post a link to your .fla, zipped up and in MX only format.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top