Copy link to clipboard
Copied
I'm a novice. I'm trying to use a combobox to navigate to different scene in my .fla. I was able to use a conditional (if) statement which seems to work but it only allows me to use the "if" and "else if" statement once before giving an error. i examined information on using a "switch" but haven't had any luck understanding the coding or getting it to work. The following is the code I've wrote. Can anyone provide me some guidance? Thanks in advance.
cb1.addEventListener(Event.CHANGE, home_dl);
function home_dl(e:Event)
{
if (cb1.selectedItem.label == "A - B")
{
gotoAndPlay(65, "a-b");
}
else if (cb1.selectedItem.label == "C - D")
gotoAndPlay(65, "c-d");
}
At a quick glance it looks like you are missing an opening curly brace following your second if()
else if (cb1.selectedItem.label == "C - D") {
Also, while it is probably just a copy/paste error, you are short one closing brace for the function
function home_dl(e:Event)
{
if (cb1.selectedItem.label == "A - B")
{
gotoAndPlay(65, "a-b");
}
else if (cb1.selectedItem.label == "C - D") {
gotoAndPlay(65, "c-d");
}
}
Copy link to clipboard
Copied
Ok, so the other key is knowing that it's a child of fl_controls. I did try looking there, but I wonder if I landed on an obsolete page. When I pick fl.controls, I get a different page, (with a 404 at the bottom):
https://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/fl/controls/package-detail.html
Next I'm trying to set the color and thickness of the pulldown button and the border.
Copy link to clipboard
Copied
looks ok to me. everything i'd expect is listed there.
whatever is triggering the 404 at page bottom doesn't appear related to the fl.controls.
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more