0

我想menubar.handmove在鼠标离开按钮时让它可见。但是,当我越过/单击按钮时,可见性将是错误的,但当我将鼠标移到按钮上时不会返回 true。

我应该怎么办?

stop();

menubar.play_but.addEventListener(MouseEvent.CLICK, playgame);
menubar.intr_but.addEventListener(MouseEvent.MOUSE_OVER, overdown1);
menubar.play_but.addEventListener(MouseEvent.MOUSE_OVER, overdown);
menubar.intr_but.addEventListener(MouseEvent.CLICK, instruc);
stage.addEventListener(MouseEvent.MOUSE_MOVE, menu);

var mouseE:Boolean = false;

function playgame(e:MouseEvent):void {
gotoAndPlay(63);
mouseE=true;
}

function overdown(e:MouseEvent):void {
 mouseE=true;
}

function instruc(e:MouseEvent):void {
gotoAndPlay(64);
mouseE=true;
}

function overdown1(e:MouseEvent):void {
mouseE=true;
}

function menu(e:MouseEvent):void {

if(mouseE==false;){
menubar.handmove.visible=true;
}else{
menubar.handmove.visible=false;
}
}
4

1 回答 1

0

您应该将此代码添加到现有代码中:

menubar.intr_but.addEventListener(MouseEvent.MOUSE_OUT, moveout);
menubar.play_but.addEventListener(MouseEvent.MOUSE_OUT, moveout);

function moveout(e:MouseEvent):void {
    mouseE=false;
}

还要删除字符;以成功编译。必须:

if(mouseE==false){
于 2012-09-19T10:30:03.443 回答