# Drawing Api Trouble

**URL:** <https://forum.kirupa.com/t/drawing-api-trouble/327178>\
**Category:** flash\
**Created:** [February 10, 2012, 10:50pm UTC](https://forum.kirupa.com/t/drawing-api-trouble/327178 "2012-02-10T22:50:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rimacy](https://avatars.discourse-cdn.com/v4/letter/r/839c29/32.png) [@rimacy](https://forum.kirupa.com/u/rimacy)\
**Post date:** [February 10, 2012, 10:50pm UTC](https://forum.kirupa.com/t/drawing-api-trouble/327178/1 "2012-02-10T22:50:11Z")

</div>

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.

```auto
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])
                        }
                    }

```
