# Better Way to Change Shape

**URL:** <https://forum.kirupa.com/t/better-way-to-change-shape/24837>\
**Category:** flash\
**Created:** [July 5, 2003, 8:24pm UTC](https://forum.kirupa.com/t/better-way-to-change-shape/24837 "2003-07-05T20:24:23Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![DariusMonsef](https://avatars.discourse-cdn.com/v4/letter/d/a6a055/32.png) [@DariusMonsef](https://forum.kirupa.com/u/DariusMonsef)\
**Post date:** [July 5, 2003, 8:24pm UTC](https://forum.kirupa.com/t/better-way-to-change-shape/24837/1 "2003-07-05T20:24:23Z")

</div>

I want to create the effect of a box getting bigger on click and bouncing back on release.

I’ve created it using shape tweens, but it looks pixelated and blurry. Is there a better way to create this using AS? Is there a better way to make the movement look more fluid, or bouncy 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:** [July 5, 2003, 8:53pm UTC](https://forum.kirupa.com/t/better-way-to-change-shape/24837/2 "2003-07-05T20:53:32Z")

</div>

hmm… I dont know… Your problem is with the actual vectors kinda being pixelly…

this is kinda a strech (quite stupid too) but an idea nevertheless. You could make a line of dots out of a movieClip that has a small 1x1 box. Then using AS you can change their motion up and down. Would still be a little pixelly though…

Hmm… or you can cheat and use images =D.

sorry,  
Aditya

---

<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:** [July 5, 2003, 11:46pm UTC](https://forum.kirupa.com/t/better-way-to-change-shape/24837/3 "2003-07-05T23:46:10Z")

</div>

_goes through tonnes of fla’s_

Ok, this is it (it can be much more beautiful(sp?), but it works ;)):

```auto
 onClipEvent(load){
this.onPress = function(){
	this.sizer = 300;
}
this.onRelease = function(){
	this.sizer = 100;
};
this.sizer = 100;
_parent.stop();

this.onEnterFrame = function(){
	factor = (factor + (this.sizer - this._xscale)/15)*.9; /* adjust the 15 and .9 to your liking */
	this._xscale = this._yscale += factor;
}
}

```

It’s in MX format though. God, I love MX. Be sure your ‘button’ is a movieclip, do you can put this on it.

---

<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:** [July 6, 2003, 1:30am UTC](https://forum.kirupa.com/t/better-way-to-change-shape/24837/4 "2003-07-06T01:30:42Z")

</div>

[m]

Thank will work, but I need it to on click grow and bounce back to it’s orginal size, then on release shrink and then go back to regular size.

I’m not too sharp on AS, how can I edit this to do that?

---

<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:** [July 6, 2003, 1:50am UTC](https://forum.kirupa.com/t/better-way-to-change-shape/24837/5 "2003-07-06T01:50:48Z")

</div>

```auto
 onClipEvent(load){
this.onPress = function(){
	this._xscale = this._yscale = 300;
}
this.onRelease = function(){
	this._xscale = this._yscale = 33;
};
this.sizer = 100;
_parent.stop();

this.onEnterFrame = function(){
	factor = (factor + (100 - this._xscale)/15)*.9; /* adjust the 15 and .9 to your liking */
	this._xscale = this._yscale += factor;
}
}

```

Something like this?

---

<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:** [July 6, 2003, 2:04am UTC](https://forum.kirupa.com/t/better-way-to-change-shape/24837/6 "2003-07-06T02:04:15Z")

</div>

first I very much appreciate your help.

second, almost. It is growing on click then shirnking back to orig size, but the it doesn’t really grow to the bigger size, it more of jumps then shrinks.

Does that make sense?

I want the elasticity to grow then shrink to original size, then on release elastically shrink then return to orig size.

Thanks again.

---

<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:** [July 6, 2003, 2:21am UTC](https://forum.kirupa.com/t/better-way-to-change-shape/24837/7 "2003-07-06T02:21:23Z")

</div>

That growing, do you mean with springing or without a ‘spring’,ie gradually growing?

---

<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:** [July 6, 2003, 2:24am UTC](https://forum.kirupa.com/t/better-way-to-change-shape/24837/8 "2003-07-06T02:24:06Z")

</div>

The growing should have some spring but not such a severe jump to full size.
