3 Replies Latest reply on Dec 31, 2009 10:52 AM by Anne Tuohy

    Checking user input

    Khadiga Mohamed

      I want the user to use an editable zone and type one word. I want Director to check the answer and decide to move on to a certain frame if the answer is correct. To make this easier to understand let's consider this. I want the user to see a question on the screen saying something like "What is the capital of France?" I want the user to type "Paris" and then the answer can be checked. How can all this be designed in Director? Thanks for your help.

        • 1. Re: Checking user input
          Sean_Wilson Adobe Community Professional

          See my response on the other forum you posted to

          • 2. Re: Checking user input
            Anne Tuohy

             

             

            this code workedfor me

             

            when user types in a word presses the enter key

             

            the event calls a moveon method. you can call moveon anyname  you like

             

            input is a blank textfield if the answer is right the word well done is inserted into the textfield. you can also have a second textfield to put the words welldone or try again. You can also use an text input box to do this , but I could lnot change the font size that way.

             

            Hope it worksfor you.

             

            on keydown

              if the key = return or the key = enter then

                moveon

              else

                pass

              end if

            end

             

             

            on moveon me

              if member("input").text = "house" then

                member ("input").text = "Well done!"

               

              else

                member ("input").text = "try again"

               

               

              end if

             

            end

             

             

             

            on keydown

              if the key = return or the key = enter then

                moveonhorse

              else

                pass

              end if

            end

            • 3. Re: Checking user input
              Anne Tuohy Level 1

              you can leave

              out the last seven lines of the code that is a mistake. hope im not confusing you