# Smooth roll over/out buttons

**URL:** <https://forum.kirupa.com/t/smooth-roll-over-out-buttons/104473>\
**Category:** Uncategorized\
**Created:** [March 16, 2004, 4:29pm UTC](https://forum.kirupa.com/t/smooth-roll-over-out-buttons/104473 "2004-03-16T16:29:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kev](https://avatars.discourse-cdn.com/v4/letter/k/e9bcb4/32.png) [@kev](https://forum.kirupa.com/u/kev)\
**Post date:** [March 16, 2004, 4:29pm UTC](https://forum.kirupa.com/t/smooth-roll-over-out-buttons/104473/1 "2004-03-16T16:29:20Z")

</div>

Hi all, I have searched this forum and every example had an attached file which for some reason was missing??

Anyway I want to produce a menu like the one on [http://www.flashlevel.net](http://www.flashlevel.net) (the sliding one second top right)

At the moment I have an animation (10 frames) 1-5 plays the roll over and 6-10 palys the reverse roll out!

Here is the code i have used:

[AS]  
on (rollOver) {  
if (\_root.button1.\_currentframe \> 1) {  
tellTarget (“button1”) {  
;  
}  
}  
if (\_root.button1.\_currentframe == 1) {  
tellTarget (“button1”) {  
play ();  
}  
}  
}  
on (rollOut) {  
if (\_root.button1.\_currentframe \< 5) {  
tellTarget ("\_root.button1") {  
play ();  
}  
}  
if (\_root.button1.\_currentframe == 5) {  
tellTarget ("\_root.button1") {  
play ();  
}  
}  
}  
on (release) {  
getURL (“home.htm”, “mainFrame”);  
}

[/AS]

This works! but move the mouse quickly and the animation is stuck half way through either animation and either jumps or sticks! because frame 1 & 5 are safe any other and it don’t work 🙂

how can I have this working what ever frame the animation is on it will play smoothely

Thanks in advance (I apologies for this question again, it has been answered many times I am sure)
