Copy link to clipboard
Copied
Im working on an if statement that checks values, and depending on the programs mode it will require different values. For some reason it breaks with my else statements. I need someone to take a look and see what im getting wrong.
Right now it just automatically jumps to this statement
else if (menu1.currentFrame == 3 && menu1.panelmenu.currentFrame == 5 && elecBrkNums == 21 && quizMode =="on" )
{
function electokay():void
{
if (menu1.currentFrame == 3 && menu1.panelmenu.currentFrame == 4 && electricLenNums != 0 && quizMode == "off")
{
menu1.panelmenu.gotoAndStop(5);
}
else if (menu1.currentFrame == 3 && menu1.panelmenu.currentFrame == 4 && electricLenNums == 1 && quizMode =="on" )
{
menu1.panelmenu.gotoAndStop(5);
}
else if (menu1.currentFrame == 3 && menu1.panelmenu.currentFrame == 4 && electricLenNums != 1 && quizMode =="on" )
{
trace("incorrect");
}
if (menu1.currentFrame == 3 && menu1.panelmenu.currentFrame == 5 && elecBrkNums != 0 && quizMode == "off")
{
inputClips.visible = true;
ui.visible = true;
mod.visible = true;
menu1.visible = false;
mod.gotoAndStop(10);
clearfun();
menu1Seeio();
electoff.nextFrame();
electoff.electinput.nextFrame();
inputClips.visible = false;
}
else if (menu1.currentFrame == 3 && menu1.panelmenu.currentFrame == 5 && elecBrkNums == 21 && quizMode =="on" )
{
inputClips.visible = true;
uiMes.visible = true;
uiMes.gotoAndStop(1);
ui.visible = true;
mod.visible = true;
menu1.visible = false;
mod.gotoAndStop(10);
clearfun();
menu1Seeio();
electoff.nextFrame();
electoff.electinput.nextFrame();
inputClips.visible = false;
}
else if (menu1.currentFrame == 3 && menu1.panelmenu.currentFrame == 5 && elecBrkNums != 21 && quizMode =="on" )
{
trace("incorrect");
}
}
Use the trace function before any of the conditionals to see what the values of the conditions are. That will help you determine why things land where they land
You can simplify your efforts by combining all the conditions that repeat into one initial condition (namely: menu1.currentFrame == 3, menu1.panelmenu.currentFrame == 4, and menu1.panelmenu.currentFrame == 5 )
Copy link to clipboard
Copied
Use the trace function before any of the conditionals to see what the values of the conditions are. That will help you determine why things land where they land
You can simplify your efforts by combining all the conditions that repeat into one initial condition (namely: menu1.currentFrame == 3, menu1.panelmenu.currentFrame == 4, and menu1.panelmenu.currentFrame == 5 )
Copy link to clipboard
Copied
Ah right I forgot about my old friend trace
Find more inspiration, events, and resources on the new Adobe Community
Explore Now