Actionscript 3 动作脚本3。如何禁用允许单击功能?
我正在制作一款闪存游戏,想找出两张相等的牌,但我有一个问题。 当我发现第二张牌时,程序写入:错误转向,显示1秒,但此时我可以发现其他牌,第三张、第四张等。我需要添加类似AllowClick=false函数的内容,直到显示两张牌 据我所知,我需要使用: …RemoveEventListenerMouseeEvent.CLICK,选中卡片;你能帮我正确使用它吗 以下是我的部分代码:Actionscript 3 动作脚本3。如何禁用允许单击功能?,actionscript-3,flash,function,actionscript,flash-cs5,Actionscript 3,Flash,Function,Actionscript,Flash Cs5,我正在制作一款闪存游戏,想找出两张相等的牌,但我有一个问题。 当我发现第二张牌时,程序写入:错误转向,显示1秒,但此时我可以发现其他牌,第三张、第四张等。我需要添加类似AllowClick=false函数的内容,直到显示两张牌 据我所知,我需要使用: …RemoveEventListenerMouseeEvent.CLICK,选中卡片;你能帮我正确使用它吗 以下是我的部分代码: else { trace("Wrong
else
{
trace("Wrong");
_message = "Wrong";
message_txt.text = _message;
_secondCard = event.currentTarget;
var timer:Timer = new Timer(1000, 1); //antros kortos atsivertimo laikas
timer.addEventListener(TimerEvent.TIMER_COMPLETE, flipBack);
timer.start();
}
}
protected function flipBack(event:TimerEvent):void
{
_firstCard.gotoAndPlay("flipBack");
_firstCard.addEventListener(MouseEvent.CLICK, checkCards);
_firstCard = _secondCard = undefined;
}
我希望你能理解我的问题。你能帮帮我吗?非常感谢。您是否尝试将所有其他元素的.mouseEnabled设置为false,.mouseChildren设置为false?请参见此处:谢谢您的回答。我已经尝试过了。mouseEnabled=false用于_card、_firstCard、_secondCard,但同样,对我没有帮助。不,您需要将这些参数设置为除第一张和第二张之外的所有卡