# Actionscript mask, border, and background

**URL:** <https://forum.kirupa.com/t/actionscript-mask-border-and-background/151447>\
**Category:** flash\
**Created:** [June 15, 2005, 3:15pm UTC](https://forum.kirupa.com/t/actionscript-mask-border-and-background/151447 "2005-06-15T15:15:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jaredcunha](https://avatars.discourse-cdn.com/v4/letter/j/3da27b/32.png) [@jaredcunha](https://forum.kirupa.com/u/jaredcunha)\
**Post date:** [June 15, 2005, 3:15pm UTC](https://forum.kirupa.com/t/actionscript-mask-border-and-background/151447/1 "2005-06-15T15:15:51Z")

</div>

Hello, I’m wondering if anyone could provide me with a tutorial or any useful code to creat a mask, border, and background to an image using actionscript. Here’s what the layers will look like.

Layer 4 (Border): 1px stroke of a rounded rectangle  
Layer 3 (Mask): Rounded rectangle fill to mask image  
Layer 2 (Image): The image  
Layer 1 (Background): Rounded rectangle no stroke

I would like to get layers 1,3, and 4 to get the width, height, and x & y coordinates of layer 2 and size and place themselves accordingly. Layer 1 will be positioned 3 pixels to right and 3 pixels down.

Would each element (border, mask, image, background) need to be a graphic symbol or movie clip? Either way, let’s say the instance names are relavent.

This would be great to save some time. Instead of manually resizing the layers to fit the image, we can just have everything on the stage and let them resize themselves via actionscript according to the size and location of the image. (perhaps sort of along the lines of a flash version of a photoshop action or CSS class).

Any help would be greatly appreciated.
