1 Reply Latest reply on Mar 29, 2007 4:43 PM by Newsgroup_User

    Help - Code Translation - Help

    Ani_K
      i've got this sentence & i really need to put it into lingo form asap. Please help got a deadline on Friday 30th March at 6pm!!!!

      on keyDown
      if key is wrong deduct a point etc (i.e key not eqaul to letter)
      else my_count = my_count + 1 -if my_count> 15 then stop
      letter = my_source.char[random(Ltot)]
      sprite(my_count + 10).member = letter
      sprite(my_count + 10).visible = TRUE
      the_score = the_score + 5
      member("scoredisplay").text= "Score: " & the_score
      end if
      end if
      end

      PLEASE HELP asap!!
      Ani_K
        • 1. Re: Help - Code Translation - Help
          Level 7
          In article <euh1ul$rfu$1@forums.macromedia.com>,
          "Ani_K" <webforumsuser@macromedia.com> wrote:

          > on keyDown
          > if key is wrong deduct a point etc (i.e key not eqaul to letter)
          > else my_count = my_count + 1 -if my_count> 15 then stop
          > letter = my_source.char[random(Ltot)]
          > sprite(my_count + 10).member = letter
          > sprite(my_count + 10).visible = TRUE
          > the_score = the_score + 5
          > member("scoredisplay").text= "Score: " & the_score
          > end if
          > end if
          > end


          Some lines look ready to go, here are some thoughts on the more abstract
          ones:

          > if key is wrong deduct a point etc (i.e key not eqaul to letter)

          if the key <> "a" then
          my_count = my_count - 1
          else -- key was right (A expected in example)
          my_count = my_count + 1
          end if

          if my_count> 15 then go to "endGame" -- marker without keydown haodner


          > letter = my_source.char[random(Ltot)]
          > sprite(my_count + 10).member = letter

          -- not sure what your going for there, do you have members named "L",
          "M", "N" ...?


          letter seems to not be used anywhere else, you could directly select
          from a list of member names:

          myMems = [ "ltrL", "ltrM", "ltrN" ]

          sprite(my_count + 10).member = getAt(myMems, random(count(myMems))