# Joshua Davis like buttons

**URL:** https://forum.kirupa.com/t/joshua-davis-like-buttons/195713
**Category:** flash
**Created:** [August 2, 2006, 3:47pm UTC](https://forum.kirupa.com/t/joshua-davis-like-buttons/195713 "2006-08-02T15:47:18Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![doublea100](https://avatars.discourse-cdn.com/v4/letter/d/ba9def/32.png) [@doublea100](https://forum.kirupa.com/u/doublea100)
#### Post date: [August 2, 2006, 3:47pm UTC](https://forum.kirupa.com/t/joshua-davis-like-buttons/195713/1 "2006-08-02T15:47:18Z")

</div>

Hey there,

I’ve been having trouble with this all afternoon. I’m trying to create this little button effect using setInterval and the laco tween class ( [http://laco.wz.cz/tween/?page=docs/tween ). I’m trying to get an effect similar to the little portfolio buttons on the right third of Joshua Davis’ site http://joshuadavis.com/](http://laco.wz.cz/tween/?page=docs/tween) I’ve attached the fla, and here is the code.

Frame1:  
#include “lmc\_tween.as”

blue.setMask(mask);

blue.tween("\_x", 29, .8, “easeOutSine”);

function wait() {  
stop();  
var myInterval = setInterval(function () {  
play();  
clearInterval(myInterval);  
}, 2\*1000); // stop for 2 seconds  
}

wait();

two.onRollOver=function(){  
gotoAndPlay(“two”);

}

Frame2:

blue.tween("\_x", 49, .8, “easeOutSine”);

function wait2() {  
stop();  
var myInterval2 = setInterval(function () {  
gotoAndPlay(“one”);

clearInterval(myInterval2);  
}, 2\*1000); // stop for 2 seconds  
}

wait2();

one.onRollOver=function(){  
gotoAndPlay(“two”);  
}

You’ll notice that the masking back-and-forth effect works perfectly, but as soon as I try to advance the animation with the button rollovers, the timing of the animation gets all off. I imagine it has something to do with the intervals looping???

Any help is greatly appriciated!
