Hi guys, i have an annoying problem. I have a mc that i use as a button. I have an external class that controls the button and adds interactivity to it, here’s part of the code:
package
{
import flash.display.*;
import flash.text.*;
import flash.geom.ColorTransform;
import flash.events.*;
public class BtnCuadSelect extends MovieClip
{
public function BtnCuadSelect():void
{
this.mouseChildren=false;
this.buttonMode=true;
init();
}
public function init():void
{
addEventListener(MouseEvent.MOUSE_OVER,over);
addEventListener(MouseEvent.MOUSE_OUT ,up);
addEventListener(MouseEvent.MOUSE_DOWN ,down);
}
private function over(evt:MouseEvent):void
{
//acciones...
}
private function up(evt:MouseEvent):void
{
//acciones...
}
private function down(evt:MouseEvent):void
{
removeEventListener(MouseEvent.MOUSE_OVER,over);
removeEventListener(MouseEvent.MOUSE_OUT ,up);
removeEventListener(MouseEvent.MOUSE_DOWN ,down);
this.buttonMode=false;
}
}
}
The problem is, i want the btn that, when clicked, remain inactive.That’s why I remove all the listeners in the class. HOWEVER, it still functions as a button, I mean the functions haven’t been removed at all after I click it. What’s wrong here?? Why are the functions still there, if I have removed them when clicked at the btn??? :S
Any help, please?