    package components.Tools
    {
        import flash.display.Sprite;

        // desenha a mao livre e as linhas quando control acionado
        public class BannerPencil extends Sprite{
            private var type:String = 'pen';
            public var cordX:Array;
            public var cordY:Array;
            private var initP:Number = 0;
            public var lineColor:uint;
            public var lineWidth:Number;

            public function BannerPencil(lCol:uint,lWidth:Number,lAlpha:Number){
                cordX = new Array();
                cordY = new Array();
                paint(lCol,lWidth,lAlpha);
            }
            private function paint(lCol:uint,lWidth:Number,lAlpha:Number):void{
                this.graphics.lineStyle(lWidth, lCol, lAlpha);
                this.graphics.moveTo(0,0);
                lineWidth = lWidth;
                lineColor = lCol;
            }
            public function moveto(xPos:Number, yPos:Number):void{
                this.graphics.lineTo(xPos,yPos);
                cordX[initP] = xPos;
                cordY[initP] = yPos;
                initP++;
            }
            public function straight(xPos:Number, yPos:Number, lCol:uint, lWidth:Number, lAlpha:Number):void{
                this.graphics.clear();
                this.graphics.lineStyle(lWidth, lCol, lAlpha);
                this.graphics.moveTo(0,0);
                this.graphics.lineTo(xPos,yPos);
                cordX[0] = xPos;
                cordY[0] = yPos;
                type = 'line';
                lineWidth = lWidth;
                lineColor = lCol;
            }
            public function changeLine(lCol:uint, lWidth:Number):void{
                this.graphics.clear();
                this.graphics.lineStyle(lWidth, lCol, 1.0);
                lineWidth = lWidth;
                lineColor = lCol;
                this.graphics.moveTo(0,0);
                if(type == 'pen'){
                    for(var i:int=0; i<cordX.length; i++){
                        this.graphics.lineTo(cordX[i],cordY[i]);
                    }
                }else{
                    this.graphics.lineTo(cordX[0],cordY[0]);
                }
            }
        }
    }