title: Drag a point in flash, and have lines, connected other points move
body: <p>I have a set of dots displayed on the canvas (key bits of code pulled out):</p>
  
  <pre><code>// Drop points based on x y coords
  for (var i = 0; i &lt; 50; i++) {
      itemPoint[i] = new mcDot();
      itemPoint[i].x = 500*Math.random();
      itemPoint[i].y = 500*Math.random();
  
      // Set up drag &amp; drop
      initDragger(itemPoint[i]);
      itemPoint[i].buttonMode = true;
  
      addChild(itemPoint[i]);
  }
  </code></pre>
  
  <p>I then connect the dots - one dot could have 50 connections</p>
  
  <pre><code>// Draw connections
  for (i = 0; i &lt; 50; i++) {
           for (j = 0; j &lt; 50; j++) {
          // Is there a connection in the matrix? 
          if (connectMatrix[i][j] &gt; 0) {
              itemConnect[k] = new Shape();
  
              itemConnect[k].graphics.lineStyle(1, 0x000000);
  
             // Connect the line to the dots
              itemConnect[k].graphics.moveTo(itemPoint[i].x, itemPoint[i].y);
              itemConnect[k].graphics.lineTo(itemPoint[j].x, itemPoint[j].y);
              addChild(itemConnect[k++]);
          }
      }
  }
  </code></pre>
  
  <p>I have drag and drop working for the dot:</p>
  
  <pre><code>/** Drag and drop functions */
  function initDragger(mc:MovieClip):void {
      mc.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
      mc.addEventListener(MouseEvent.MOUSE_UP, mouseUpHandler);
  }
  
  function mouseDownHandler(e:MouseEvent):void {
      e.currentTarget.startDrag();
  }
  function mouseUpHandler(e:MouseEvent):void {
      e.currentTarget.stopDrag();
  }
  </code></pre>
  
  <p>However, I am really stuck on how to redraw the lines as I move a dot. Also there could be many lines connected to any single dot. Do I need to somehow register which lines are connected to which dot? How do I redrew the lines based on this?</p>
  
  <p>Thanks</p>