1 Reply Latest reply on May 4, 2006 11:48 PM by Newsgroup_User

    Need Help

      I have this project to do, and I'm trying to make a typing tutor game...Can anyone tell me a way to make it so that when a word in a field is typed, some thing happens eg. A bomb falling from the sky has a word on it, when you type the word, the bomb explodes. Can anyone help me?
        • 1. Re: Need Help
          Level 7
          Assuming the simplified case that user is typing into the end of a
          field, and has not moved insert point to somewhere in the middle.

          attach this to the field or text sprite.

          on keyUp me
          wordsList ["cat", "dog", "orangatang", "elephant"]
          w = getPos(wordsList, the last word of sprite(me.spriteNum).member.text)
          if w then -- no match gives zero
          --- call your animate action passing wordsList[w]
          end if

          -- this might do as a controled concept demo.
          -- problems include getPos being case sensitive, an on mouseDown handler
          could convert typed upper case to lower case to make entries match
          wordsList. After a word has been completed the next keyUp (probably
          space) will still math the last word of the field to the word list,
          could add test for last char = space or return.