My code will draw the lines that reflect the game ships momentum but I cant figure out how to get rid of the old line and draw a the new one . As it stands I get a neat looking starburst pattern.
if (momentumGauge == true)
{
trace("v1918 momentumGaugearray"+momentumGaugeArray.length);
//var line:Shape = new Shape();
var magnitude:Number = 12;
if(momentumGaugeArray.length<100)
{
line.graphics.lineStyle(1,0xEACF42);
line.graphics.moveTo(-40, -30);
if (_model.xVel == 0 && _model.yVel == 0)
{
line.graphics.lineTo( -40, -30);
}
else
{
line.graphics.lineTo((-40+(_model.xVel*magnitude)),(-30+ (_model.yVel*magnitude)));
}
line.x = 260;
line.y = 220;
addChild(line);
momentumGaugeArray.push(line);
if (momentumGaugeArray.length>99)
{
removeChild(momentumGaugeArray[0])
}
}