# Scale with actionscript

**URL:** <https://forum.kirupa.com/t/scale-with-actionscript/61045>\
**Category:** Uncategorized\
**Created:** [August 15, 2004, 10:11am UTC](https://forum.kirupa.com/t/scale-with-actionscript/61045 "2004-08-15T10:11:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![elwatie](https://avatars.discourse-cdn.com/v4/letter/e/a587f6/32.png) [@elwatie](https://forum.kirupa.com/u/elwatie)\
**Post date:** [August 15, 2004, 10:11am UTC](https://forum.kirupa.com/t/scale-with-actionscript/61045/1 "2004-08-15T10:11:00Z")

</div>

how to scale an object using actionscript?as you know scaling using motion tween is not as smooth as using as.

---

<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:** [August 15, 2004, 10:26am UTC](https://forum.kirupa.com/t/scale-with-actionscript/61045/2 "2004-08-15T10:26:25Z")

</div>

```auto
<objectname>._xscale = <value>;
<objectname>._yscale = <value>;

```

or

```auto
<objectname>._width = <value>;
<objectname>._height = <value>;

```

that will change the size. But there are so many ways to implement this, it’s hard to know where to start.

as a quick example, here is a prototype that will shrink an item, and remove it once it’s \<1% of it’s original size:

```auto
MovieClip.prototype.shrinker = function() {
 this.onEnterFrame = function() {
  if (this._xscale>1) {
   this._xscale--;
  } else {
   this.removeMovieClip();
  }
 }
}

```

I just slapped this up, so it might not work, but it looks okay.

then just call it with

```auto
<movieclip>.shrinker();

```
