4 Replies Latest reply on Aug 17, 2007 3:44 PM by FlashTastic

    constraining symbols to a line

    sarahbarber
      Hi, Could someone please tell me how to constrain a symbol to a specific line,
      I have it so that the symbol is following the mouse around the page but I would like it to only follow it across a particular line.
      simaler to this website....
      http://www.building-solutions.co.nz/BS2.html

      This is the code I have used for mouse following with ease and it works well:

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


      If someone could tell me how to do this I would be really grateful =)