# \[FMX\] draw and size box w/ AS

**URL:** <https://forum.kirupa.com/t/fmx-draw-and-size-box-w-as/11901>\
**Category:** flash\
**Created:** [January 23, 2003, 6:48pm UTC](https://forum.kirupa.com/t/fmx-draw-and-size-box-w-as/11901 "2003-01-23T18:48:47Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![jcs](https://avatars.discourse-cdn.com/v4/letter/j/439d5e/32.png) [@jcs](https://forum.kirupa.com/u/jcs)\
**Post date:** [January 23, 2003, 6:48pm UTC](https://forum.kirupa.com/t/fmx-draw-and-size-box-w-as/11901/1 "2003-01-23T18:48:47Z")

</div>

love the way fonts for flash ([http://www.fontsforflash.com/](http://www.fontsforflash.com/)) opens those different boxes for content to go in. Would like to experiment with this, but need help. I can build the box with teh drawing API, but how do they resize it?

thanks,  
JCS

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 24, 2003, 1:17pm UTC](https://forum.kirupa.com/t/fmx-draw-and-size-box-w-as/11901/2 "2003-01-24T13:17:38Z")

</div>

draw it inside a clip, resize the clip (width/height)…

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 24, 2003, 5:30pm UTC](https://forum.kirupa.com/t/fmx-draw-and-size-box-w-as/11901/3 "2003-01-24T17:30:35Z")

</div>

Hey eyez… for movie clips it is \_width and \_height to resize width and height I believe is for Stage.width and Stage.height.

And yes… \_width and \_height allow you to resize by pixels and \_xscale and \_yscale allow you to resize by percent of the current size.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 24, 2003, 5:40pm UTC](https://forum.kirupa.com/t/fmx-draw-and-size-box-w-as/11901/4 "2003-01-24T17:40:18Z")

</div>

thanks guys

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 24, 2003, 5:45pm UTC](https://forum.kirupa.com/t/fmx-draw-and-size-box-w-as/11901/5 "2003-01-24T17:45:57Z")

</div>

No problem. On a lighter note… if you resize an object to bigger than the original size, it usually causes the border to stretch too, making it look ugly.

When I do this I make the box as bis as the stage and resize it smaller right after I draw it (with the drawing API). This way you can resize it to whatever and experience no distortion.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 24, 2003, 6:46pm UTC](https://forum.kirupa.com/t/fmx-draw-and-size-box-w-as/11901/6 "2003-01-24T18:46:59Z")

</div>

nice! I had noticed that too, but hadn’t thought about “working backwards” like that. A great point!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 25, 2003, 2:12pm UTC](https://forum.kirupa.com/t/fmx-draw-and-size-box-w-as/11901/7 "2003-01-25T14:12:34Z")

</div>

You can do it that way… Or you can avoid the resizing problems by just designing a function…

```php

MovieClip.prototype.buildBox = function(x1, y1, x2, y2)
{
     // just add the x1,y1,x2,y2 values in here
     // it shouldn't be too large to do it this 
     // way and you have more control over
     // the number of boxes you can have
}

// This would be how you would call that...

_root.createEmptyMovieClip("box", 100);
_root.box.buildBox(100,100,200,200);

```

It would then create a box to the dimensions you set it for at those locations…

Later On
