1 Reply Latest reply on Jul 5, 2006 4:30 AM by SciEntiSt@c2w

    Limiting "Follow Mouse Event"

    Manu503
      Hi Everybody!!

      In my actual web project I need the following code (on object, e.g. a ball) for following the mouse:

      onClipEvent (load) {
      _x = 0;
      _y = 0;
      speed = 10;
      }
      onClipEvent (enterFrame) {
      endX = _root._xmouse;
      endY = _root._ymouse;
      _x += (endX-_x)/speed;
      _y += (endY-_y)/speed;
      }

      How can I limit the area on the screen where this should be active?

      Thanks!!
      Mark