Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Broken If Statment

New Here ,
Mar 19, 2013 Mar 19, 2013

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

          }

}

TOPICS
ActionScript
373
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Mar 19, 2013 Mar 19, 2013

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  )

Translate
LEGEND ,
Mar 19, 2013 Mar 19, 2013

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  )

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 19, 2013 Mar 19, 2013
LATEST

Ah right I forgot about my old friend trace

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines