# Reactivating a class - help, I've coded myself into a corner and there are sharks!

**URL:** <https://forum.kirupa.com/t/reactivating-a-class-help-ive-coded-myself-into-a-corner-and-there-are-sharks/311554>\
**Category:** Uncategorized\
**Created:** [July 9, 2010, 7:24pm UTC](https://forum.kirupa.com/t/reactivating-a-class-help-ive-coded-myself-into-a-corner-and-there-are-sharks/311554 "2010-07-09T19:24:59Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubl3](https://avatars.discourse-cdn.com/v4/letter/d/dfb087/32.png) [@dubl3](https://forum.kirupa.com/u/dubl3)\
**Post date:** [July 9, 2010, 7:24pm UTC](https://forum.kirupa.com/t/reactivating-a-class-help-ive-coded-myself-into-a-corner-and-there-are-sharks/311554/1 "2010-07-09T19:24:59Z")

</div>

Reactivating a class - help, I’ve coded myself into a corner and there are sharks there! I took a look around but haven’t seen anything about this for AS3, ive built a class that does all the regular for my standard button animation, nothing too complicated to a point. But I’m sort of in a corner as far as reactivating the button after i turn it off. I would think that i could reactivate it on click of another button, but since this is all stated in a class i cant figure out how to reactivate all but the “this.” my code is below and i would really appreciate the help, thanks.

```auto
package {
	
	import flash.display.MovieClip
	import flash.events.MouseEvent
	
	public class ButtonClass extends MovieClip {

	public function ButtonClass() 
	{
		this.addEventListener(MouseEvent.ROLL_OVER, over);
		this.addEventListener(MouseEvent.ROLL_OUT, out);
		this.addEventListener(MouseEvent.CLICK, clicked);
		this.buttonMode = true ;
	}
	
	private function over(event:MouseEvent):void
	{
		this.gotoAndPlay(2);
	}
	
	private function out(event:MouseEvent):void  
	{
		this.gotoAndPlay(22);
	}
	
	private function clicked(event:MouseEvent):void  
	{
		this.gotoAndStop(48);
		
		this.removeEventListener(MouseEvent.ROLL_OVER, over);
		this.removeEventListener(MouseEvent.ROLL_OUT, out);
		this.buttonMode = false ;
		
	}
	
	}
	
}

```
