# Scale to grid

**URL:** <https://forum.kirupa.com/t/scale-to-grid/301358>\
**Category:** Uncategorized\
**Created:** [December 8, 2009, 9:58am UTC](https://forum.kirupa.com/t/scale-to-grid/301358 "2009-12-08T09:58:15Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![regbolD](https://avatars.discourse-cdn.com/v4/letter/r/ecccb3/32.png) [@regbolD](https://forum.kirupa.com/u/regbolD)\
**Post date:** [December 8, 2009, 9:58am UTC](https://forum.kirupa.com/t/scale-to-grid/301358/1 "2009-12-08T09:58:15Z")

</div>

can you have 9 slice scaling with object drawn in flash api, not with code?  
i am trying to draw a simple rectangle on stage (200 px wide, 100 px tall, with 2 line stroke), and apply scale to grid but i am getting an error:

ArgumentError: Error #2004: One of the parameters is invalid

and i really dont know whats wrong…

var slice9rect:Rectangle = new Rectangle(10, 10, 180, 80);  
all.scale9Grid = slice9rect;

edit:  
nevermind, the children were causing problems…

also, good read on scale to grid.  
[http://www.ovidiudiac.ro/blog/2009/05/scale9grid-work-and-fail/](http://www.ovidiudiac.ro/blog/2009/05/scale9grid-work-and-fail/)
