 import flash.display.GraphicsGradientFill;
 import flash.display.GraphicsStroke;
 import flash.geom.Matrix;
+import flash.geom.Point;
 import flash.geom.Rectangle;
 
 import mx.core.mx_internal;

    /**
     *  @private
     */
    override public function createGraphicsStroke(bounds:Rectangle):GraphicsStroke
    {
        // The parent class sets the gradient stroke properties common to 
        // LinearGradientStroke and RadialGradientStroke 
        var graphicsStroke:GraphicsStroke = super.createGraphicsStroke(bounds); 
        
        if (graphicsStroke)
        {
            // Set other properties specific to this LinearGradientStroke  
            GraphicsGradientFill(graphicsStroke.fill).type = GradientType.LINEAR; 
            calculateTransformationMatrix(bounds, commonMatrix);
            GraphicsGradientFill(graphicsStroke.fill).matrix = commonMatrix; 
        }
        

     *  @private
     *  Calculates this LinearGradientStroke's transformation matrix.  
     */
    private function calculateTransformationMatrix(targetBounds:Rectangle, matrix:Matrix, targetOrigin:Point):void
    {
        if (!compoundTransform)
        {
            var w:Number = !isNaN(scaleX) ? scaleX : targetBounds.width;            
            var bX:Number = !isNaN(x) ? x + targetOrigin.x : targetBounds.left;
            var bY:Number = !isNaN(y) ? y + targetOrigin.y : targetBounds.top;
                        
            matrix.createGradientBox(w, targetBounds.height, 
                                    !isNaN(_angle) ? 
                                        _angle : rotationInRadians,
                                     bX, bY);   
        }
        else
        {            
            matrix.identity(); 
            matrix.translate(GRADIENT_DIMENSION / 2, GRADIENT_DIMENSION / 2);
            matrix.scale(1 / GRADIENT_DIMENSION, 1 / GRADIENT_DIMENSION);
            matrix.concat(compoundTransform.matrix);
            matrix.translate(targetOrigin.x, targetOrigin.y);
        }
    }
    
