首先,我在_txtbtn
. 然后我选择任何 mc 并在它们上创建许多侦听器。现在我想在单击时删除侦听器_can
。所以我创建了_unselect
函数。但它没有按预期工作。
function _txtbtn(e:*):void
{
myText = new TextField();
mc3 = new MovieClip();
myText.text = "text...";
myText.type = "input";
mc3.addChild(myText);
addChild(mc3);
mc3.x = _can.x;
mc3.y = p;
p = mc3.y + mc3.height + 10;
this.mc3.addEventListener(MouseEvent.MOUSE_DOWN,_select);
function _select(e:MouseEvent):void
{
tool_stage.combo.addEventListener(Event.CHANGE,_font);
tool_stage.steeper.addEventListener(Event.CHANGE,_size);
tool_stage.italic.addEventListener(MouseEvent.CLICK,_bold);
tool_stage.colPicker2.addEventListener(ColorPickerEvent.CHANGE, changeColor1);
_can.addEventListener(MouseEvent.MOUSE_DOWN,_unselect);
}
function _unselect(e:*){
mc3.removeEventListener(MouseEvent.MOUSE_DOWN,_select);
}