2 Replies Latest reply on Oct 23, 2006 9:49 AM by Newsgroup_User

    Lingo noob seeks help!

      I'm receving an error when I try and use this code. it worked fine until I included the "while the mouseDown" statements in each of the cases. I need these while statements included to ensure smooth movement. Here's the code I'm using.

      Any help would be greatly appreciated. Thanks... OOOH yeah the error is an "Expected end case statement".

      Thanks again in advance

        • 1. Re: Lingo noob seeks help!
          duckets Level 1

          What is it that you want to do?
          just move a sprite if you press the arrow keys?
          Might I suggest an alternative approach:

          Create a behaviour with the following script (attached below).
          Then place the behaviour on to your 'vector shape' sprite.

          Here's a demo of it in action: (with source dir file)

          hope this helps,

          - Ben
          • 2. Re: Lingo noob seeks help!
            Level 7
            Lingo doesn't allow you to place one function inside another. When it
            sees the first "end", it thinks that is the end of the function, and
            since there is no end case, it throws an error.

            I'm surprised that you didn't get an error on the while keyword. There
            is no while keyword in Lingo. There is a while condition for a repeat
            loop: repeat while...

            You might want to use an on exitFrame function to control the animation.
            Repeat loops are not good to use to control animation. A repeat loop
            will run as fast as possible. An exit, enter, or prepare frame function
            will run at the frame rate of the movie.

            You can then use a combination of the frame rate and the distance that
            you move the sprite to control the animation.

            Rob Dillon
            Adobe Community Expert