You are right, I do not want the contractraction to be on the about_btn, but when I programmed it using the recommendation you gave me, when the mouse leaves the about_menu, the menu contractacts upwards, which is great and thats what I need. However the about button that triggers the about menu is on a layer above the about menu, if you could imagine a rectangle inside of a box towards the top. So when the menu is triggered the menu comes out, but then if you roll over the button (which is no part of the menu) the menu goes away. Is there anyway to get rid of this problem? Do I have to add an additional function?
just add both the btn and menu to the hittest:
import fl.transitions.Tween;
import fl.transitions.easing.Regular;
import fl.transitions.easing.Elastic;
import flash.events.MouseEvent;
stop();
menu_cont.about_rect.alpha = 0;
menu_cont.about_btn.addEventListener(MouseEvent.ROLL_OVER, aboutRollOver);
var tween:Tween;
function aboutRollOver (event:MouseEvent):void {
tween = new Tween(menu_cont.about_menu, "y", Regular.easeOut, menu_cont.about_menu.y, 2.5, .5, true);
this.addEventListener(Event.ENTER_FRAME,loopF);
}
function loopF(e:Event):void{
if(!menu_cont.about_btn.hitTestPoint(mouseX,mouseY,true) && !about_btn.hitTestPoint(mouseX,mouseY)){
this.removeEventListener(Event.ENTER_FRAME,loopF);
aboutMouseOut();
}
}
function aboutMouseOut ():void {
tween = new Tween(menu_cont.about_menu, "y", Regular.easeOut, menu_cont.about_menu.y, -147.5, .5, true);
}