# Adding a border around a sprite

**URL:** <https://forum.kirupa.com/t/adding-a-border-around-a-sprite/304686>\
**Category:** Uncategorized\
**Created:** [February 11, 2010, 8:16pm UTC](https://forum.kirupa.com/t/adding-a-border-around-a-sprite/304686 "2010-02-11T20:16:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Navarone](https://avatars.discourse-cdn.com/v4/letter/n/f9ae1b/32.png) [@Navarone](https://forum.kirupa.com/u/Navarone)\
**Post date:** [February 11, 2010, 8:16pm UTC](https://forum.kirupa.com/t/adding-a-border-around-a-sprite/304686/1 "2010-02-11T20:16:22Z")

</div>

I want to add a border around my mask. I don’t know if I can add the border directly to the mask or if I need to create something new and position it. I imagine if the border was part of the mask it wouldnt show up? Anyway I added lineStyle to my roomMask and I get this error that doesn’t make any sense to me:

1061: Call to a possibly undefined method lineStyle through a reference with static type flash.display:Sprite.

Is this saying you can’t have a lineStyle on a Sprite? I am not sure what I am doing wrong here.

```
ActionScript Code:
[LEFT][COLOR=#808080]*//create a mask to cover the room container *[/COLOR]
        [COLOR=#808080]*//to hide the floor outside edges*[/COLOR]
        [COLOR=#000000] **var** [/COLOR] roomMask:Sprite = [COLOR=#000000] **new** [/COLOR] Sprite[COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR]; 
        roomMask.[COLOR=#0000FF]lineStyle[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000080]6[/COLOR], 0x0000FF, [COLOR=#000080]0[/COLOR].[COLOR=#000080]5[/COLOR][COLOR=#000000])[/COLOR];           
        roomMask.[COLOR=#000080]graphics[/COLOR].[COLOR=#0000FF]beginFill[/COLOR][COLOR=#000000]([/COLOR]0xFF00ff[COLOR=#000000])[/COLOR];
        roomMask.[COLOR=#000080]graphics[/COLOR].[COLOR=#000080]drawRoundRect[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000080]0[/COLOR],[COLOR=#000080]0[/COLOR],[COLOR=#000080]662[/COLOR],[COLOR=#000080]411[/COLOR],[COLOR=#000080]15[/COLOR],[COLOR=#000080]15[/COLOR][COLOR=#000000])[/COLOR];
        roomMask.[COLOR=#000080]graphics[/COLOR].[COLOR=#0000FF]endFill[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR];
        addChild[COLOR=#000000]([/COLOR]roomMask[COLOR=#000000])[/COLOR];
        roomMask.[COLOR=#000080]x[/COLOR] = [COLOR=#000080]28[/COLOR];
        roomMask.[COLOR=#000080]y[/COLOR] = [COLOR=#000080]110[/COLOR];
        roomContainer.[COLOR=#000080]mask[/COLOR] = roomMask;

```

[/LEFT]
