5 Replies Latest reply on Feb 8, 2011 7:40 PM by flydream27

    Display correct answer when answer wrongly!!!!

    flydream27

      Hello

       

      I am a beginner in Adobe Director, so i have a lot of thing want to learn. I am doing a Math quiz now and i am facing some problem when showing answer.

       

      Each question I will give user 4options to select, and when their answer is correct then there will a pop out to show them "correct", but if their answer is wrong then will pop out "wrong" and will have a button display to let user click and show them solution.

       

      I am using the sample movie that provided by adobe.

       

      I dont know how to write this code, so can somebody teach me !!!!

       

      Any help much appreciated.

       

      David

        • 1. Re: Display correct answer when answer wrongly!!!!
          Jhon Carlo Level 1

          Wich is the sample movie?

          • 3. Re: Display correct answer when answer wrongly!!!!
            Jhon Carlo Level 1

            I sugest to learn with little step.

            I supose you want to write a new code (I don't know if the sample movie it is free code).

            And I don't know wich kind of test do you want do.

            With text you can try this:

             

            on mouseUp me
              if member("x").text = member("y").text then
                member("$").text = "ok"
              end if
              if member("x").text <> member("y").text then
                member("$").text = "ko"
              end if
            end

             

            on mouseUp me
              member("x").text = ""
              member("y").text = ""
              member("$").text = ""
            end

             

            You need to have three text member (set to editable inside the property inspector window) named "x" "y" end "&".
            Put on the stage member "y" and member "$".
            Type your question inside member "x" (member x must be of the stage) and type on the stage your answer in the member("y").
            Then click on the button with inside the first mouse up script. To clean  the all text click the button with the second mouse up script.

             

            Tell me if it work.

            (I'm also a beginer).

            1 person found this helpful
            • 4. Re: Display correct answer when answer wrongly!!!!
              Jhon Carlo Level 1

              I've read better your question and maybe you need to use the radio box.

              The property of the radio box can be checked (Hilite = true) or unchecked (Hilite = false),   so you need to have four check box on your stage (named like in the script below), and four text (named like in the script below), you need also to have a button with this script to use after the user give the four answer:

              on mouseUp me

                if  member("MyRadioBox1").hilite = true then

                  member("answer1").text = "correct"

                end if

                if  member("MyRadioBox1").hilite = false then

                  member("answer1").text = "wrong"

                end if

                if  member("MyRadioBox2").hilite = true then

                  member("answer2").text = "correct"

                end if

                if  member("MyRadioBox2").hilite = false then

                  member("answer2").text = "wrong"

                end if

                if  member("MyRadioBox3").hilite = true then

                  member("answer3").text = "correct"

                end if

                if  member("MyRadioBox3").hilite = false then

                  member("answe3r").text = "wrong"

                end if

                if  member("MyRadioBox4").hilite = true then

                  member("answer4").text = "correct"

                end if

                if  member("MyRadioBox4").hilite = false then

                  member("answer4").text = "wrong"

                end if

              end

               

              You must arrange the script changing the false or true condition

              or "wrong" or "right" position.

               

              Let me know.

              1 person found this helpful
              • 5. Re: Display correct answer when answer wrongly!!!!
                flydream27 Level 1

                Thanks alot, still trying, will udpate to u ..ths