# How to add stroke to a sprite?

**URL:** <https://forum.kirupa.com/t/how-to-add-stroke-to-a-sprite/327710>\
**Category:** flash\
**Created:** [March 21, 2012, 11:23pm UTC](https://forum.kirupa.com/t/how-to-add-stroke-to-a-sprite/327710 "2012-03-21T23:23:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![GeekTweak\_0](https://avatars.discourse-cdn.com/v4/letter/g/b5ac83/32.png) [@GeekTweak\_0](https://forum.kirupa.com/u/GeekTweak_0)\
**Post date:** [March 21, 2012, 11:23pm UTC](https://forum.kirupa.com/t/how-to-add-stroke-to-a-sprite/327710/1 "2012-03-21T23:23:36Z")

</div>

I have a series of previously created rectangles, all with a lineStyle(stoke), but later, when in the program, i highlight them via colorTranform with MOUSE\_OVER, and and return the color back to its previous state with MOUSE\_OUT, and try to re-apply the lineStyle, it returns the color, but not the lineStyle.

Here is my code:

```auto
function highlightSquare(e:MouseEvent)
{
    if (building == true)
    {
        transform1.color = 0x00CCFF;
        var temp1 = e.currentTarget;
        temp1.transform.colorTransform = transform1;
    }
}

function unHighlightSquare(e:MouseEvent)
{
    if (building == true)
    {
        transform1.color = 0x00cc33;
        var temp1 = e.currentTarget;
        temp1.transform.colorTransform = transform1;
        temp1.graphics.lineStyle(1,0x0033ff);
    }
}

```

any help or suggestions? thanks.
