1 Reply Latest reply on Aug 3, 2013 2:16 PM by Sean_Wilson

    Random Location

    DirBuddy12 Level 1

      I am trying to move a sprite randomly, this is as far as I have got but I have got the error message comma expected?


      I had placed a comma between the two random numbers but it seemed more logical to put a plus sign. Both the comma and the place returned the same error message, any advice on where I have gone wrong would be very helpful thank ful.


      on beginSprite

      sprite(28).loc(random(240) + (random(240))


        • 1. Re: Random Location
          Sean_Wilson Adobe Community Professional

          You need to press F1 and learn more about the commands, properties and inner workings of Lingo and how to implement them.


          A sprite's location is a property, a point on the stage. A point is a combination of a horizontal location and a vertical location. You were probably wanting something more like:

          on beginSprite me
            sprite(28).loc = point(random(240), (random(240))