3 Replies Latest reply on Jun 18, 2014 10:40 AM by kglad

    Gravity in as2

    Elon G

      Hey I'm new at AS, and i have been trying to make an object (a ball) fall within gravity but nothing happens when i'm running the swf.

       

      here's the code:

       

       

      onClipEvent (load) {

          fallMax = 0;

      }

      onClipEvent (enterFrame) {

          if (ball._y < 300)

          {

              _y += fallMax;

              if (fallMax < 10)

              {

                  fallmax++;

              }

          }

      }

       

      what am i doing wrong?