all groups > flash actionscript > april 2004 >
You're in the

flash actionscript

group:

If then with Listbox component


If then with Listbox component MINGUITO
4/4/2004 7:33:31 PM
flash actionscript:
Hi Folks,

Maybe this is more easy than i think, but how would one use the If then
statement with a ListBox, in other words, let's say I have the following code:

list.addItem("Flash MX Release");
list.addItem("My birthday");
list.addItem("Flash Festival in France");
list.addItem("I leave to Singapore");
list.addItem("Christmas");
list.addItem("Ilyas President");
list.addItem("Cows come home");

Now, I would like to add some If and Then statements with the appropriate
destination using GotoandPlay, like if the user where to choose "I leave to
Singapore", I would like to have and If then statement that the user choose
that particular item and it goes play another keyframe............I would
appreciate any input on this...Thanks and God Bless...

Take care and God Bless...
www.ymisitio.com

Re: If then with Listbox component Jack.
4/4/2004 8:58:42 PM
use frame labels on your keyframes,
add these frame labels as data to the listbox -

list.addItem("Flash MX Release","f1");
list.addItem("My birthday","f2");

//set a changeHandler function for the listbox -
list.setChangeHandler("handle");

//and use the data returned to go to the keyframe -
function handle(comp){
var d = comp.getSelectedItem().data; trace(d);
gotoAndStop(d);
};

(F6MX)
hth
Re: If then with Listbox component MINGUITO
4/5/2004 12:38:00 AM
Thanks Jack for the help, I really appreciate......Take care and God Bless :)

Take care and God Bless...
www.ymisitio.com

AddThis Social Bookmark Button