Search code examples
actionscript-3lineshapes

Modify shape as3


Say I have a line drawn with several edges using Shape.graphics' moveTo() and lineTo() methods. Can I modify one of these edges later? so for example:

var line:Shape = new Shape();
line.graphics.lineStyle(2, 0x000000, .75);

line.graphics.moveTo(10,10);              
line.graphics.lineTo(50,50); // Can I modify coordinates of the edge created on this line?

Solution

  • NO, you can't. Once drawn there is no reference to the lines, so you can't modify them. You need to clear the graphics and redraw again.