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.
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 ;
}
}
}