To remove all vector drawings in an object, we use the Graphics class's instance method clear( ).
package{
import flash.display.*;
public class Main extends Sprite{
public function Main(){
var canvas:Shape = new Shape( );
canvas.graphics.lineStyle(3, 0x0000FF); // Apply blue stroke
canvas.graphics.lineTo(25, 35);
addChild(canvas);
canvas.graphics.clear( );
}
}
}
Related examples in the same category