Hey guys, I’m new to the forum, although I’ve read it a lot. I hope you don’t mind answering a newbie question. I have a menu that I want to drop down from the top of the screen. A part is shown, and it drops on mouse over. It works, but it flickers if your mouse is in just the right spot (ie it breaks sometimes). Is this something I should ignore? Am I being to anal about it? Here are the two versions I have:
This is the “corrected” version with timers to prevent the flickering. It doesn’t fire on mouse over sometimes, though. So I’m stuck. One way flickers, the other doesn’t fire off sometimes. I’ve ran into this before many times too. Is there a simple solution that I’m missing?
import fl.transitions.Tween;
import fl.transitions.easing.*;
//boolean records open/closed state
var opened:Boolean = false;
menuBG.addEventListener(MouseEvent.MOUSE_OVER, openMenu);
menuBG.addEventListener(MouseEvent.MOUSE_OUT, closeMenu);
function openMenu(e:MouseEvent):void
{
if (opened == false)
{
{
new Tween(menuBG, “y”, Strong.easeOut, -50, 50, 0.5, true);
var myTimer:Timer = new Timer(500, 1);
myTimer.addEventListener(TimerEvent.TIMER, timedFunction);
myTimer.start();
}
}
}
function timedFunction(e:TimerEvent)
{
opened = true;
}
function closeMenu(e:MouseEvent):void
{
if (opened == true)
{
new Tween(menuBG, “y”, Strong.easeOut, 50, -50, 0.5, true);
var myTimer2:Timer = new Timer(500, 1);
myTimer2.addEventListener(TimerEvent.TIMER, timedFunction2);
myTimer2.start();
}
}
function timedFunction2 (e:TimerEvent):void
{
opened = false;
}
I’m stumped. Usually in this situation I set a speed interval that updates on “enter frame” and stops at a limit, but this is too complex, right?