# How did they do this?

**URL:** <https://forum.kirupa.com/t/how-did-they-do-this/185093>\
**Category:** Uncategorized\
**Created:** [April 10, 2006, 10:12pm UTC](https://forum.kirupa.com/t/how-did-they-do-this/185093 "2006-04-10T22:12:07Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![station8](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/station8/32/2345_2.png) [@station8](https://forum.kirupa.com/u/station8)\
**Post date:** [April 10, 2006, 10:12pm UTC](https://forum.kirupa.com/t/how-did-they-do-this/185093/1 "2006-04-10T22:12:07Z")

</div>

Hi, I hope i am posting this in the right place.

I’m trying to figure out how a certain effect was done at this - [http://www2.foxsearchlight.com/thankyouforsmoking/](http://www2.foxsearchlight.com/thankyouforsmoking/) - site. The effect I’m interested in is the button rollover thing they are doing. the elastic drag effect on rollover. I’ve tried a few things, but have been way off. Any help would be GREAT and appreciated! thanks a lot…

---

<div class="post-metadata">

**Author:** ![theHollow](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/thehollow/32/106_2.png) [@theHollow](https://forum.kirupa.com/u/theHollow)\
**Post date:** [April 11, 2006, 3:13am UTC](https://forum.kirupa.com/t/how-did-they-do-this/185093/2 "2006-04-11T03:13:21Z")

</div>

STICKY BUTTONS!!! gotta love 'em. I saw them on [mjau-mjau.com/classic.html](http://mjau-mjau.com/classic.html) about a year ago and wanted to know how to make them so bad. Eventually i worked it out myself. i have the .fla file at home somewhere but im at school atm. so if you don’t mind waiting about 5 hours i can post it when i get home.

---

<div class="post-metadata">

**Author:** ![station8](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/station8/32/2345_2.png) [@station8](https://forum.kirupa.com/u/station8)\
**Post date:** [April 11, 2006, 3:22am UTC](https://forum.kirupa.com/t/how-did-they-do-this/185093/3 "2006-04-11T03:22:48Z")

</div>

thank you, i can wait!!!

---

<div class="post-metadata">

**Author:** ![rhamej](https://avatars.discourse-cdn.com/v4/letter/r/bb73d2/32.png) [@rhamej](https://forum.kirupa.com/u/rhamej)\
**Post date:** [April 11, 2006, 3:58am UTC](https://forum.kirupa.com/t/how-did-they-do-this/185093/4 "2006-04-11T03:58:47Z")

</div>

=)  
[http://www.kirupa.com/forum/showthread.php?t=181649](http://www.kirupa.com/forum/showthread.php?t=181649&highlight=Sticky+Buttons)

---

<div class="post-metadata">

**Author:** ![theHollow](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/thehollow/32/106_2.png) [@theHollow](https://forum.kirupa.com/u/theHollow)\
**Post date:** [April 11, 2006, 4:15am UTC](https://forum.kirupa.com/t/how-did-they-do-this/185093/5 "2006-04-11T04:15:05Z")

</div>

I got bored (as most people do at school) so i made it for you. Heres my .fla. I have looked at the one from the thread rhamej posted but it was a while ago. i think mine is alot faster.

all the code involving the variables spX and spY isnt mine i got it from a tutorial on elasticity.

---

<div class="post-metadata">

**Author:** ![theHollow](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/thehollow/32/106_2.png) [@theHollow](https://forum.kirupa.com/u/theHollow)\
**Post date:** [April 11, 2006, 4:21am UTC](https://forum.kirupa.com/t/how-did-they-do-this/185093/6 "2006-04-11T04:21:39Z")

</div>

A quick explanation. Basically what its doing is when the mouse is over the button its calculating the distance between the mouse and where the movie was initially and moving the movieclip to 65% of that distance:

this.newX = this.lockX + (\_root.\_xmouse - this.lockX) \* **0.65** ;

and the mouse leaves it moves it to the original position. im still not sure how the elasticity works though.

---

<div class="post-metadata">

**Author:** ![station8](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/station8/32/2345_2.png) [@station8](https://forum.kirupa.com/u/station8)\
**Post date:** [April 11, 2006, 4:40pm UTC](https://forum.kirupa.com/t/how-did-they-do-this/185093/7 "2006-04-11T16:40:57Z")

</div>

great! i’m gonna give this a shot. thanks again for all of your help. i’ll let you know how it works…

---

<div class="post-metadata">

**Author:** ![station8](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/station8/32/2345_2.png) [@station8](https://forum.kirupa.com/u/station8)\
**Post date:** [April 11, 2006, 8:20pm UTC](https://forum.kirupa.com/t/how-did-they-do-this/185093/8 "2006-04-11T20:20:06Z")

</div>

works like a charm!! thanks for all the help.
