# Elastic button A.script

**URL:** <https://forum.kirupa.com/t/elastic-button-a-script/24215>\
**Category:** flash\
**Created:** [June 27, 2003, 10:11am UTC](https://forum.kirupa.com/t/elastic-button-a-script/24215 "2003-06-27T10:11:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tiina](https://avatars.discourse-cdn.com/v4/letter/t/5fc32e/32.png) [@Tiina](https://forum.kirupa.com/u/Tiina)\
**Post date:** [June 27, 2003, 10:11am UTC](https://forum.kirupa.com/t/elastic-button-a-script/24215/1 "2003-06-27T10:11:23Z")

</div>

Hey all!:trout:

I am trying to insert the elastic actionscript code of [this button into [URL=http://www.in2illusions.com/elasticity\_into\_this.fla]this text button](http://www.in2illusions.com/22.ElasticStickbutton.fla) , but i can´t seem to get it to work.  
I want the text button to move the way the ellipse button moves when you roll over the mouse.  
Could somebody please help me with this?:\*(

regards: Daisy

* * *

---

<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 27, 2003, 10:40am UTC](https://forum.kirupa.com/t/elastic-button-a-script/24215/2 "2003-06-27T10:40:40Z")

</div>

1. the code won’t work in a Button, convert in to MovieClip or put the Button into a MovieClip.

2. define the variables friction, ratio and maxDistance.

3. check the attached FLA. 😛

---

<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 27, 2003, 3:06pm UTC](https://forum.kirupa.com/t/elastic-button-a-script/24215/3 "2003-06-27T15:06:57Z")

</div>

Thank you Kax!:love:  
You think there would be a way to make the text sharp even when it moves?Because when you roll over the text and the text starts to move it turn all blurry:(

Thank you 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:** [June 27, 2003, 5:55pm UTC](https://forum.kirupa.com/t/elastic-button-a-script/24215/4 "2003-06-27T17:55:45Z")

</div>

you can round the value, but the movement might look a bit choppy. :-\

replace the last two lines of code in the onClipEvent (enterFrame) handler with this code:

```auto
_x = Math.round(_x+newX);
_y = Math.round(_y+newY);

```

that should do…
