# How to make a button pulse

**URL:** <https://forum.kirupa.com/t/how-to-make-a-button-pulse/200537>\
**Category:** flash\
**Created:** [September 13, 2006, 1:36am UTC](https://forum.kirupa.com/t/how-to-make-a-button-pulse/200537 "2006-09-13T01:36:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Terry\_elekes](https://avatars.discourse-cdn.com/v4/letter/t/8baadc/32.png) [@Terry\_elekes](https://forum.kirupa.com/u/Terry_elekes)\
**Post date:** [September 13, 2006, 1:36am UTC](https://forum.kirupa.com/t/how-to-make-a-button-pulse/200537/1 "2006-09-13T01:36:36Z")

</div>

I am trying to make a button pulse when you rollover it and keep your mouse on it. I could use some help with te code below. I do understand what i am missing. The button grows when the mouse is over it and shrinks when you roll out but I would like it to pulse when on rollover. This is the code on the movieclip

onClipEvent(load) {  
// set initial scale to 100  
newscale = 100;  
}  
onClipEvent(enterFrame) {  
if (this.\_xscale \> newscale) {  
// shrink  
this.\_xscale -= 10;  
this.\_yscale -= 10;  
} else if (this.\_xscale \< newscale) {  
// grow  
this.\_xscale += 10;  
this.\_yscale += 10;

}  
}

and this is the code on the button inside the movieclip  
on (rollOver) {  
// set up for grow  
newscale = 150;

}  
on (rollOut) {  
// set up for shrink  
newscale = 100;  
}  
on (release) {  
// do something  
trace(“Home”);  
}
