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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to link a Combo Box to different Scenes

Status
Not open for further replies.

giuliand

Programmer
Jul 26, 2004
4
AU
Hi,
I am new to using flash mx 2004. i have never really used flash but i am going through tutorials and learning alot this way. one thing i have been searching for and would really appreciate your help is linking combo boxes.

What I would like to do is be able to have a user select a field in the combo box and once this is done the scene changes.

For example in my flash tutorial i would like users to be able to select either pizza, pasta, cakes and from what ever one the user choices the scene will be different and match the selection (e.g. pizza scene, pasta scene, cake scene).

Would really appreciate if you could explain how to do this or the code required.

Thanks in Advance,
GD
 
Example if combobox is named myCombo:

Code:
myListener = new Object();
myListener.change = function(component){
   comboSelection = component.target.value;//.label will give you the label instead of the data

   if(comboSelection == "Fruit"){
      gotoAndPlay("Scene2",1);
   }
}

myCombo.addEventListener("change",myListener);

Hope it helps.

Wow JT that almost looked like you knew what you were doing!
 
Thank you for your help that coding works great!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top