# Button animation and onRelease?

**URL:** https://forum.kirupa.com/t/button-animation-and-onrelease/245097
**Category:** flash
**Created:** [November 26, 2007, 12:54pm UTC](https://forum.kirupa.com/t/button-animation-and-onrelease/245097 "2007-11-26T12:54:11Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![bern494](https://avatars.discourse-cdn.com/v4/letter/b/a183cd/32.png) [@bern494](https://forum.kirupa.com/u/bern494)
#### Post date: [November 26, 2007, 12:54pm UTC](https://forum.kirupa.com/t/button-animation-and-onrelease/245097/1 "2007-11-26T12:54:11Z")

</div>

Hi  
Please do not throw me off the forum with this simple question (hopefully)  
I promise you I have done ny research to rectfy it but to no avail!

I have a button that plays an animation on rollover then after the animation I want the users to click and open up an external swf file.  
But the animation works great until I put the code onRelease pointing to my swf and I cannot work out why? It just will not animate. I have tried onPress. It does however load the swf with onRelease and onPress. Also I need to hide button after, has it opens up in same window.  
The code below:  
\<code\>  
myButton\_mc.btn\_txt.text = “Thenext”;  
myButton\_mc.hit\_mc.onRollOver = function() {  
this.\_parent.ani\_mc.play();  
myButton\_mc.onRelease= function() {  
mcLoader.loadClip(“thenext.swf”,myLoader);  
myButton\_mc.\_visible = false;

```
}

```

};  
\</code\>

Any help please  
Bern
