PDA

View Full Version : combo box? (MX)


salud
06-07-2002, 07:23 PM
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

leblob
06-08-2002, 02:02 AM
let's say your combobox instance name is mybox

put this on your action layer , on frame 1 :


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();


hope this helps :)

salud
06-08-2002, 02:27 AM
please see file

Thanks,
Salud

leblob
06-08-2002, 01:08 PM
*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 :)

salud
06-08-2002, 01:56 PM
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,

leblob
06-08-2002, 02:25 PM
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):)

salud
06-08-2002, 04:32 PM
You were right... Now works just fine