Hi there,
I’m having trouble to get hittest to work. At least if this is the best method to use with the thing I’m trying to do…
Here’s the situation:
http://www.earfocus.com/debie/preview/index.htm
So what I want is that when you mouse over “navigation”, the dropdown menu becomes visible, and when you leave that same navigation, OR the dropdown menu itself, it disappears again… This last thing is giving me some difficulties.
Here is the code I use:
[AS]navigationBar_mc.onEnterFrame = function():Void {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
if(_root._xmouse >= 340 || _root._xmouse <= 428){
clearInterval(nInterval);
nInterval = setInterval(moveMenu, 50, nDown);
}
} else {
clearInterval(nInterval);
nInterval = setInterval(moveMenu, 50, nUp);
}
}[/AS]
And here is the function I call with the intervals:
[AS]function moveMenu(nYTargetMenu):Void {
_root.dropDown_mc._y += (nYTargetMenu - _root.dropDown_mc._y)/nSpeed;
}[/AS]
Am I doing things right here? Is hittest the way to go? I know you can achieve it with motiontweens instead of actionscript, but I rather do it the hard way
Or should I perhaps use some prototype function?
Any help is appreciated,
Sintax