# Drawing and animating a rectangle - MX2004

**URL:** <https://forum.kirupa.com/t/drawing-and-animating-a-rectangle-mx2004/185433>\
**Category:** flash\
**Created:** [April 13, 2006, 11:05am UTC](https://forum.kirupa.com/t/drawing-and-animating-a-rectangle-mx2004/185433 "2006-04-13T11:05:35Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![CaroD](https://avatars.discourse-cdn.com/v4/letter/c/eb8c5e/32.png) [@CaroD](https://forum.kirupa.com/u/CaroD)\
**Post date:** [April 13, 2006, 11:05am UTC](https://forum.kirupa.com/t/drawing-and-animating-a-rectangle-mx2004/185433/1 "2006-04-13T11:05:35Z")

</div>

Seemingly simple question - I want to draw a rectangle (1px border, no fill) and then scale it using ActionScript. If I scale the movieclip, obviously the border scales as well. Is there any way to scale a dynamically created shape in ActionScript?

Thanks in advance,

Caroline.

---

<div class="post-metadata">

**Author:** ![matthewjumps](https://avatars.discourse-cdn.com/v4/letter/m/49beb7/32.png) [@matthewjumps](https://forum.kirupa.com/u/matthewjumps)\
**Post date:** [April 13, 2006, 11:39am UTC](https://forum.kirupa.com/t/drawing-and-animating-a-rectangle-mx2004/185433/2 "2006-04-13T11:39:29Z")

</div>

research the drawing API

---

<div class="post-metadata">

**Author:** ![CaroD](https://avatars.discourse-cdn.com/v4/letter/c/eb8c5e/32.png) [@CaroD](https://forum.kirupa.com/u/CaroD)\
**Post date:** [April 13, 2006, 11:53am UTC](https://forum.kirupa.com/t/drawing-and-animating-a-rectangle-mx2004/185433/3 "2006-04-13T11:53:17Z")

</div>

Drawing is not the problem - animating a scale is. What I wanted to know was if there is any way to do it without scaling each of the four vertices independently.

---

<div class="post-metadata">

**Author:** ![icleric](https://avatars.discourse-cdn.com/v4/letter/i/4bbf92/32.png) [@icleric](https://forum.kirupa.com/u/icleric)\
**Post date:** [April 13, 2006, 12:38pm UTC](https://forum.kirupa.com/t/drawing-and-animating-a-rectangle-mx2004/185433/4 "2006-04-13T12:38:44Z")

</div>

here you are 🙂 hope that helps there are better ways in flash 8 though…

---

<div class="post-metadata">

**Author:** ![mathew\_er](https://avatars.discourse-cdn.com/v4/letter/m/94ad74/32.png) [@mathew\_er](https://forum.kirupa.com/u/mathew_er)\
**Post date:** [April 13, 2006, 12:41pm UTC](https://forum.kirupa.com/t/drawing-and-animating-a-rectangle-mx2004/185433/5 "2006-04-13T12:41:54Z")

</div>

In Flash 8, MovieClip.lineStyle method contains also scale parameter which could do the job, but unfortunately you are using MX 2k4… If you specify thickness of that line as 0, it will take it as hairline and draw it allways 1px wide.

---

<div class="post-metadata">

**Author:** ![CaroD](https://avatars.discourse-cdn.com/v4/letter/c/eb8c5e/32.png) [@CaroD](https://forum.kirupa.com/u/CaroD)\
**Post date:** [April 13, 2006, 12:50pm UTC](https://forum.kirupa.com/t/drawing-and-animating-a-rectangle-mx2004/185433/6 "2006-04-13T12:50:45Z")

</div>

Cheers mathew.er and icleric - I had found the additional noScale parameter in Flash 8 (which I’m actually using, but have to export to Flash 7 as the client wants it in 7) - but I hadn’t thought of specifying the line as 0, that’s completely fixed my problem. Thanks a million!=)
