# Removing Rollover state w/ Actionscript

**URL:** <https://forum.kirupa.com/t/removing-rollover-state-w-actionscript/190938>\
**Category:** flash\
**Created:** [June 15, 2006, 9:17pm UTC](https://forum.kirupa.com/t/removing-rollover-state-w-actionscript/190938 "2006-06-15T21:17:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![funfunfun](https://avatars.discourse-cdn.com/v4/letter/f/9fc348/32.png) [@funfunfun](https://forum.kirupa.com/u/funfunfun)\
**Post date:** [June 15, 2006, 9:17pm UTC](https://forum.kirupa.com/t/removing-rollover-state-w-actionscript/190938/1 "2006-06-15T21:17:10Z")

</div>

Hello.

I am trying to remove a rollover and rollout states from a button, AFTER  
the button has been pressed. I want to KEEP that button in its pressed state once pressed. How might I do this? Thanks for anyone’s thoughts.

Here is my code:

```auto
stop();

bttnEv.onRollOver = function() {
overOne.gotoAndPlay(2);
}

bttnEv.onRollOut = function() {
overOne.gotoAndPlay(5);
}

bttnEv.onPress = function() {
overOne.gotoAndStop(9);
delete bttnEv.onRollOver;
delete bttnEv.onRollOut;
}

```
