# Action for buttons with AS

**URL:** https://forum.kirupa.com/t/action-for-buttons-with-as/103489
**Category:** Uncategorized
**Created:** [March 5, 2004, 6:47pm UTC](https://forum.kirupa.com/t/action-for-buttons-with-as/103489 "2004-03-05T18:47:37Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![felipegm](https://avatars.discourse-cdn.com/v4/letter/f/e9bcb4/32.png) [@felipegm](https://forum.kirupa.com/u/felipegm)
#### Post date: [March 5, 2004, 6:47pm UTC](https://forum.kirupa.com/t/action-for-buttons-with-as/103489/1 "2004-03-05T18:47:37Z")

</div>

I applied actions to a button, but since it´s hit area is too small, the rollout sometimes fail.

i tried this code on the time line to solve the problem but it´s not working. Somebody could point the mistake?

[AS]preview.onRollOver = function()  
onEnterFrame = function() {  
tellTarget (“preview”) {  
gotoAndPlay(“efeito”);  
}  
};  
tellTarget (“ponta”) {  
gotoAndPlay(“inicio”);  
}  
};  
preview.onRollOut = function() {  
tellTarget (“ponta”) {  
gotoAndPlay(“fim”);  
}  
};  
stop();  
{[/AS]

thanks
