一旦我将鼠标悬停在蓝色 mc 上,带有图片的导航就会展开。每当鼠标悬停在导航上时,导航都会保持展开状态。一旦鼠标离开导航,它就会移回蓝色 mc 下方。
加载后,它确实应该如此。调整舞台大小使整个父 mc 居中。
问题:即使鼠标没有离开navigation-mc,stage-resize 也会触发导航的MOUSE_OUT 事件。
private function onNavOver(e:MouseEvent):void
{
this._bluemc.removeEventListener(MouseEvent.MOUSE_OVER,onMouseAreaBottomOver);
this._bluemc.removeEventListener(MouseEvent.MOUSE_OUT,onMouseAreaBottomOut);
TweenLite.to(this._navigation,0.7,{y:this._offsetY,ease:Expo.easeInOut});
TweenLite.killTweensOf(this._navigation,false);
}
private function onNavOut(e:MouseEvent):void
{
this._bluemc.addEventListener(MouseEvent.MOUSE_OVER,onMouseAreaBottomOver,false,0,true);
this._bluemc.addEventListener(MouseEvent.MOUSE_OUT,onMouseAreaBottomOut,false,0,true);
TweenLite.to(this._navigation,0.7,{y:this._initialY,ease:Expo.easeInOut});
}
上面的代码是超出或超出导航时调用的事件函数。为了保持导航打开,bluemc 事件将被删除。我认为这是一个潜在的冲突:蓝色 mc 的 MOUSE_OUT 事件可以在删除之前触发(onNavOver)。但奇怪的是,只有当我调整舞台大小时,才会出现失败。即使鼠标在导航中,导航也会向后移动。