| Home | Tutorials | Forums | Articles | Blogs | Movies | Library | Employment | Press | Buy templates |
|
|
#1 |
|
Registered User
Join Date: Oct 2001
Location: earth
Posts: 84
|
I have a movie with different layers and two of them are for combo box and labels, how can I use gotoAndPlay for specific frame according to a combo box selection: see example:
label layer: contact1 (frame 5) contact2 (frame 10) combo box: option 0 select one option 1 contact1 option 2 contact2 thanks, salud |
|
|
|
|
|
#2 |
|
Registered User
Join Date: May 2002
Location: France
Posts: 50
|
let's say your combobox instance name is mybox
put this on your action layer , on frame 1 : Code:
function myonchange(component){
if (component._name=="mybox"){
switch (component.getValue()){
case 1 : _root.gotoAndPlay("contact1");
break;
case 2 : _root.gotoAndPlay("contact2");
break;
}
}
}
mybox.setChangeHandler("myonchange");
stop();
![]() |
|
|
|
|
|
|
|
|
#3 |
|
Registered User
Join Date: Oct 2001
Location: earth
Posts: 84
|
please see file
Thanks, Salud |
|
|
|
|
|
#4 |
|
Registered User
Join Date: May 2002
Location: France
Posts: 50
|
*saw file*
in the properties/parameters of your combo box, you must not only fill up the labels field [select one, contact1, contact2] but also the data field with : [0,1,2] this way each label goes with a value, just like the select box in html. now it should work ![]() |
|
|
|
|
|
#5 |
|
Registered User
Join Date: Oct 2001
Location: earth
Posts: 84
|
Hey Leblob,
It did not work intirelly :-( Please check the file to see what's going on * If you select contact 1 nothing happens but if you select contact 2 it will take you to contact1 in a weird way (the combo box disapears for a second) Thanks, |
|
|
|
|
|
#6 |
|
Registered User
Join Date: May 2002
Location: France
Posts: 50
|
of course it does not work, you changed my code!
![]() now your code is better, cause simpler, but if you want it to work, you must replace the [0,1,2] in the data properties of your combobox with : [0,contact1,contact2] because if you dont , if you choose contact1 it will send you to frame 1, and if you choose contact2 it will send you to frame 2. and now it works (at least for me) ![]() |
|
|
|
|
|
#7 |
|
Registered User
Join Date: Oct 2001
Location: earth
Posts: 84
|
You were right... Now works just fine
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Flash MX 2004 Combo box & asp | Grizzly | Components | 2 | 09-22-2004 10:02 AM |
| combo box | dcullinane | Components | 9 | 06-21-2004 12:08 PM |
| MX bug? (combo box problem) | maxx | Components | 1 | 04-14-2003 01:57 AM |
| Flash MX Combo Box ? | dolfan76 | ActionScript 1.0 (and below) | 1 | 09-18-2002 09:50 AM |
| populate a combo box in Flash MX | joeyzeri | ActionScript 1.0 (and below) | 1 | 03-31-2002 12:21 AM |