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

flash actionscript

group:

Combobox component



Combobox component Muhly
11/29/2004 8:26:58 PM
flash actionscript: I have a flash file with a combobox component in the first scene. I can code
to navigate between scenes with this combobox, but If I put the box on say the
second scene, I can not navigate from there. I guess my question is, why can I
navigate from the first scene, but not back to the first scene with my combo
box??? Here is the code I have on the first scene. combo = new Object();
combo.change = function(){ var x = comboBox.selectedItem.label if(x == 'test'){
gotoAndStop('test, 1'); } if(x == 'test2'){ gotoAndStop('test2', 1); } if(x ==
'test3'){ gotoAndStop('test3', 1); } }
comboBox.addEventListener('change',combo); this works...shouldn't I be able to
add this code on the other scenes and navigate around like a jump menu??? Hope
you understand the question...I'm not sure I'm explaining it well. Thanks in
advance... Mike
Re: Combobox component NSurveyor
11/29/2004 10:00:57 PM
Don't navigate by Scenes. Instead, give the first frame of each Scene a Frame
Label (Eg: Frame 1,Scene 1:"fs1";Frame1,Scene2:"fs2",etc...). Then, in your
comboBox, put in the frame labels you made for each scene as the choices in
your comboBox. Then, in your script, you can use something like:
gotoAndStop("fs1"); And, to simplify your script a whole bunch:

combo = new Object();
combo.change = function(){
var x = comboBox.selectedItem.label
gotoAndStop(String(x));
}
comboBox.addEventListener("change",combo);
AddThis Social Bookmark Button