Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sliding menus

Status
Not open for further replies.

jacksplat

Programmer
Joined
Jun 19, 2001
Messages
67
Location
US
my friend is having a problem with this. i'm pretty sure hes using mx, but i'm not positive. heres the problem in his words:

this controls my sliding menu,
problem is it shifts the menu the opposite direction that i want. HELP!!!

onClipEvent (enterFrame) {
Xpos = _root.slideMenu._x;
Xdiff = (_root._xmouse - 345) - Xpos;
Xmove = Xdiff/50;
if(_root._xmouse > 0 && _root._xmouse < 350){
_root.slideMenu._x = Xpos + Xmove;
}
_root.menuPos = _root.slideMenu._x;
updateAfterEvent(enterFrame);
}
 
If all you want is to move the clip the other way add a minus sign ( I've put it before the Xdiff/50 bit)... I also would take out the updateAfterEvent() because it doesn't actually do anything in this case.

onClipEvent (enterFrame) {
Xpos = _root.slideMenu._x;
Xdiff = (_root._xmouse-345)-Xpos;
Xmove = -Xdiff/50;
if (_root._xmouse>0 && _root._xmouse<350) {
_root.slideMenu._x = Xpos+Xmove;
}
_root.menuPos = _root.slideMenu._x;
}
Slainte

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top