I have a sliding menu that works fine. However I only want it to scroll when the mouse is over it. But everything I have tried causes errors.
The menu is in 2 parts, a mask “box” and the slider “slider”.
The sider knows where the edges are from the box as below.
[AS]
top_y = _root.box._y;
bottom_y = top_y-(this._height-_root.box._height);
[/AS]
So how can I set it up so that it only moves when the mouse is over the box ? The complete code below.
[AS]
onClipEvent (load) {
ycenter = 175;
speed = .1;
top_y = _root.box._y;
bottom_y = top_y-(this._height-_root.box._height);
}
onClipEvent (enterFrame) {
var distance = _root._ymouse-ycenter;
_y -= (distance*speed);
if (this._y>=top_y) {
this._y = top_y;
} else if (this._y<=bottom_y) {
this._y = bottom_y;
}
}
[/AS]
Any help or pointers as I am at a dead end, thanks.
and you tried hittest or are you asking if thats an option? I think I would take that route. I assume the box bounding box is where you want to it to be active? just hitTest for that with _root._xmouse and _root._ymouse.