PDA

View Full Version : Mouse_out event



Theofiel
October 11th, 2009, 09:03 AM
Hi all,

I have a tab with the text menu and when you roll over the tab the menu slides out, on roll out the menu waits (timer function) and then slides back. But when I add a button inside the menu (child of menu) then the button will trigger the Mouse out event. Like the earlier post today about the hit test, I understand that the button will trigger the Mouse_out event. Is there a way to add a button but do not trigger the mouse out event, or is there an alternative for slide the menu back?

my code (just starting to learn (hope it is clean :ko:))


import caurina.transitions.*;
import flash.utils.*;

function menuTimer(evt:MouseEvent):void
{
var myTimer:Timer = new Timer(500,1);
myTimer.addEventListener(TimerEvent.TIMER, menuIn);
myTimer.start();
}

function menuOut(evt:MouseEvent):void
{
Tweener.addTween(menu, {x:0,
y:79,
time:1,
transition:"easeOutBounce"});
}

function menuIn(evt:TimerEvent):void
{
Tweener.addTween(menu, {x:-74,
y:79,
time:1,
transition:"easeOutBounce"}
);
}

menu.addEventListener(MouseEvent.MOUSE_OVER, menuOut);
menu.addEventListener(MouseEvent.MOUSE_OUT, menuTimer);

flashTrev
October 11th, 2009, 10:35 AM
use ROLL_OUT and ROLL_OVER instead. What happens is any child of the main object doesn't trigger an event like MOUSE_OUT does.

Theofiel
October 11th, 2009, 12:47 PM
Great that did the trick, thanks so much...