# Dynamic length of a rectangle

**URL:** <https://forum.kirupa.com/t/dynamic-length-of-a-rectangle/23684>\
**Category:** Uncategorized\
**Created:** [June 20, 2003, 11:03pm UTC](https://forum.kirupa.com/t/dynamic-length-of-a-rectangle/23684 "2003-06-20T23:03:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![fatalnegativ3](https://avatars.discourse-cdn.com/v4/letter/f/c67d28/32.png) [@fatalnegativ3](https://forum.kirupa.com/u/fatalnegativ3)\
**Post date:** [June 20, 2003, 11:03pm UTC](https://forum.kirupa.com/t/dynamic-length-of-a-rectangle/23684/1 "2003-06-20T23:03:47Z")

</div>

Does anyone know how to make a rectangular box that has a dynamic length ? Like I want to change it’s length or height at times when certain buttons are triggered, how do I define such a parameter? Or is it not possible? Thx in advance.

---

<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:** [June 20, 2003, 11:19pm UTC](https://forum.kirupa.com/t/dynamic-length-of-a-rectangle/23684/2 "2003-06-20T23:19:55Z")

</div>

Make a 100\*100 square and turn it into a clip. Let’s say you call it _square_ and that you have a button on the scene:

```auto
theButton.onPress = function(){
square._xscale = 354; // any length you want
square._yscale = 213; // any width you want
}

```

pom 🙂
