0 Replies Latest reply on Jul 19, 2006 10:56 AM by joeleko

    random movement limit

    joeleko
      I'm using a random movement code that works great, only my movie clip keeps leaving the stage. Is there a way to stop this?

      Here's the code:

      onClipEvent(load){
      xDir=10;
      }
      onClipEvent(enterFrame){
      _x+=xDir;
      if (random(7) == 0){
      xDir*=-1;
      }
      }

      Tthanks.