4 Replies Latest reply on May 12, 2014 11:32 AM by Ned Murphy

    Check Input Text for Correct Answer

    flashnewbie01

      Hello, I'm doing a project on colons and semicolons. I have a question " Correct the following sentence by adding a colon AND a semicolon: Everyone is going to the party at 7 30  how come I wasn’t invited?" and want to set up an input text box called "answer" and a button that when pressed checks that the correct answer "Everyone is going to the party at 7:30; how come I wasn’t invited?" is typed in the text box. If the answer is correct it goes to a frame labeled "Correct" if wrong it goes to a frame labeled "Wrong". I know nothing about action script commands and to make this work I need detailed instructions of how to do this. Thanks!

        • 1. Re: Check Input Text for Correct Answer
          Ned Murphy Adobe Community Professional & MVP

          It sounds like you are asking someone to do your assignment for you.  Is that what you are asking?  Providing detailed instructions to show you how to do it is three times as much work as that.  If you can offer some code that shows you made an effort you might get some help, though you can always wait and see if someone will do all the code for you.

          • 2. Re: Check Input Text for Correct Answer
            flashnewbie01 Level 1

            No I have the rest of the activity done it's just this one sections action script that I tried to do and couldn't figure out how to.

             

            One of the things I tried was:

             

            on(release) if(_root.answer.txt=="Everyone is going to the party at 7:30; how come I wasn’t invited?"){

              gotoAndPlay(Correct)}else{

            gotoAndPlay(Wrong)

            }

            • 3. Re: Check Input Text for Correct Answer
              flashnewbie01 Level 1

              I also tried testing a code as show below.

               

              var answerA:Array=['hello', 'Hello', 'Hello.','hello.'];

              var questionA:Array=['question 1'];

              var currentQuestion:int=0;

               

              function displayQuestionF("What do you say to greet someone?"):void{

              question_tf.text=questionA;

              }

              displayQuestionF("what do you call a grown boy");

               

              checkAnswer.addEventListener(MouseEvent.CLICK,checkF);

               

              function checkF(e:MouseEvent):void{

               

               

              if(answer_tf.text==answerA[question 1]){

              gotoAndPlay(2)

              }

              }

              • 4. Re: Check Input Text for Correct Answer
                Ned Murphy Adobe Community Professional & MVP

                I can see by your other posting that someone else has already tried doing all the code for you and that wasn't enough to satisfy you.  You should not start new postings for the same topic where someone is already trying to help.  I am going to lovck this posting and request that you return to the one you already started.  Please be sure to mark helpful and correct answers for the person helping you there.