# Creating a rectangle inside of a rectangle (AS3)

**URL:** <https://forum.kirupa.com/t/creating-a-rectangle-inside-of-a-rectangle-as3/311067>\
**Category:** flash\
**Created:** [June 26, 2010, 9:46pm UTC](https://forum.kirupa.com/t/creating-a-rectangle-inside-of-a-rectangle-as3/311067 "2010-06-26T21:46:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Scheisse](https://avatars.discourse-cdn.com/v4/letter/s/839c29/32.png) [@Scheisse](https://forum.kirupa.com/u/Scheisse)\
**Post date:** [June 26, 2010, 9:46pm UTC](https://forum.kirupa.com/t/creating-a-rectangle-inside-of-a-rectangle-as3/311067/1 "2010-06-26T21:46:42Z")

</div>

I would like to create a rectangle inside of a rectangle, starting approximately 15% inward from the right side of the other rectangle.

Can anyone help me with this? I know how to create rectangles with:

```auto

var newHotRect:MovieClip = new MovieClip();
newHotRect.graphics.beginFill(0x00FF00); 
newHotRect.graphics.drawRect(0, 0, 100, 100); 
addChild(newHotRect);

```

But how would I make another rectangle on top of that (the black one pictured) that is approximately 15% from the right?  
 ![](http://forum.kirupa.com/uploads/kirupa/6255/a159af0e47e94fec.png)

I toyed around with .right, and .bottomright with no success. Can anyone lead me in the right direction? or even finding the x and y of the upper right or bottom right side of a rectangle?
