0

好吧,我需要它很简单,但它让我发疯,我想知道 AS3 是否在影片剪辑中检测到我的鼠标。例如,我有一个影片剪辑实例“BEframes”,它位于影片剪辑“BE1”内,我想将他放在一个新的影片剪辑实例“滚动”中。所以顺序是roll > BE1 > BEframes。我想知道flash是否只检测“滚动”或者他会检测所有的movieclips,谢谢,

for(i=1;i<=77;i++){
    var str:String =("BE" + i);
    this[str].BEframes.gotoAndStop(i);
    this[str].addEventListener(MouseEvent.CLICK, clique);
    this[str].addEventListener(MouseEvent.ROLL_OVER, over);
    this[str].addEventListener(MouseEvent.ROLL_OUT, out);
    }
function clique(evt:MouseEvent):void{
    var botao:String = evt.currentTarget.name.toString();
    var num:String = botao.replace("BE", "");
    parede_esquerda.gotoAndStop(num);
}
function out(evt:MouseEvent):void {
    evt.currentTarget.gotoAndPlay("out");
}`enter code here`
function over(evt:MouseEvent):void {
    evt.currentTarget.gotoAndPlay("over");
}

*

4

2 回答 2

0

为了避免接收movieClips的mouseEvent,请将mouseEnabled设置为false,即如果您不想设置剪辑滚动的鼠标事件roll.mouseEnabled = false,那么下面的对象将接收mouseEvent

于 2013-10-18T10:41:33.633 回答
0

可能,您应该使用 MOUSE_OVER 和 MOUSE_OUT 而不是 ROLL_OVER 和 ROLL_OUT。

this[str].addEventListener(MouseEvent.MOUSE_OVER, over);
this[str].addEventListener(MouseEvent.MOUSE_OUT, out);
于 2013-10-15T15:53:17.113 回答