Hi All wizz.
I have a problem. I trying to remove an eventListener to a menu. But it seems to be some trouble with removing the Listener.
I have a menu at the bottom (see attached screenshot). Once mouse is over the menu comes up. once any menu items has been clicked I want the menu to be forced down again. The menu comes down, but it seems to take much longer time then it should and it almost looks like it is shaking. I think somehow it collides with the the evenListener MouseOver?
Does anyone has any idea of why it collides?
Heres my code:
//MAKES THE MENU GO UP WHEN HOOVER
menu_mc.addEventListener (MouseEvent.MOUSE_OVER, menuMouseOver);
function menuMouseOver (event:MouseEvent) :void{
TweenLite.to(menu_mc, 1.2, {y:stage.stageHeight+5 , ease:Quart.easeOut});
TweenLite.to(topNav_mc, 1.2, {y:stage.stageHeight-stage.stageHeight-5 , ease:Quart.easeOut});
TweenLite.to(contentLoad, 1.2, {y:stage.stageHeight-stage.stageHeight-30 , ease:Quart.easeOut});
}
//MAKES THE MENU DOWN WHEN MOUSE MOVES OUTSIDE
menu_mc.addEventListener (MouseEvent.MOUSE_OUT, menuMouseOut);
function menuMouseOut (event:MouseEvent ): void {
TweenLite.to(menu_mc, .8, {y:stage.stageHeight+186, ease:Quart.easeIn});
TweenLite.to(topNav_mc, .8, {y:212, ease:Quart.easeIn});
TweenLite.to(contentLoad, .8, {y:stage.stageHeight/2-265,x:stage.stageWidth/2-450, ease:Quart.easeIn})
}
// A MENU ITEM IS CLICKED
menu_mc.menuPlate_mc.freelance_btn.addEventListener (MouseEvent.CLICK, loadfreelance);
function loadfreelance (event:MouseEvent) :void{
menu_mc.removeEventListener (MouseEvent.MOUSE_OVER, menuMouseOver);
var request:URLRequest = new URLRequest("something.swf");
contentLoad.load(request);
addChildAt(contentLoad,0);
menuDown();
}
// FORCES THE MENU DOWN AGAIN
function menuDown(){
TweenLite.to(menu_mc, .8, {y:stage.stageHeight+186, ease:Quart.easeIn});
TweenLite.to(topNav_mc, .8, {y:212, ease:Quart.easeIn});
TweenLite.to(contentLoad, .8, {y:stage.stageHeight/2-265,x:stage.stageWidth/2-450, ease:Quart.easeIn})
Hope someone can give me a hint.
MANY THANX