weird behaviour on stage resize
As soon I hover the blue mc, the navigation with the pics expands. Whenever the mouse is over the navigation, the navigation stays expanded. As soon the mouse leaves the navigation, it moves back underneath the blue mc.
When it has been loaded, it does like it should. A resizing of the stage centers the whole parent-mc.
The problem: A stage-resize causes that the MOUSE_OUT event of the navigation fires, even though the mouse has not left the navigation-mc.
private function onNavOver(e:MouseEvent):void
{
this._bluemc.removeEventListener(MouseEvent.MOUSE_OVER,onMouseAreaBottomOver);
this._bluem开发者_如何学运维c.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});
}
the code above are the event-functions called when being over or out of the navigation. The bluemc events will be removed in order to keep the navigation opened. I think here is a potential conflict: the MOUSE_OUT event of the blue mc could be fired before removed(onNavOver). But the strange thing is that only when I resized the stage, the failure appears. The navigation moves back even when the mouse is withing the navigation.
I got it: Event-Confusion: Solved through adding ROLL_OVER/OUT events instead of MOUSE_OVER/OUT And there was a invisible MC set: mc.y= stage.stageHeight -> On stageResize its position was overlapping the navigation because it was not updated.
精彩评论