How to clear drawn line (inside a function) using button in AS3
<p>Already make lines between the points using following code (inside a function).I need to clear that lines using button.</p>

<pre><code>var v = 0;

function getLocation(a,b,c,d,e)
 {

   if (v&gt;0)
     {
       var line1:MovieClip = new MovieClip();
           line1.graphics.lineStyle(2,0x00CCFF);
           line1.graphics.moveTo(a,b);
           line1.graphics.lineTo(c,d);
           this.addChild(line1);
     }
   else
     {
      v++;
      var line2:MovieClip = new MovieClip();
          line2.graphics.lineStyle(2,0x00CCFF);
          line2.graphics.moveTo(a,b);
          line2.graphics.lineTo(mouseX,mouseY);
          this.addChild(line2);
     }
 }
</code></pre>