PDA

View Full Version : Infinite Menu w/o using onClipEvent



Bufffy
July 2nd, 2005, 10:36 PM
Is this possible? Thanks in advance!!!


//this is one of the code pieces I've been trying
scroll_menu.onEnterFrame = function() {
var speed=.5/100;
var xcenter=400;
var distance=_root._xmouse-xcenter;
_x+=(distance*speed);
if (_x > 0) _x=-1615;
if (_x < -1615) _x=0;
}

//this is the onClipEvent code
onClipEvent (load) {
xcenter=400;
speed=.5/100;
}
onClipEvent (enterFrame) {
var distance=_root._xmouse-xcenter;
_x+=(distance*speed);
if (_x > 0) _x=-1615;
if (_x < -1615) _x=0;
}

Bufffy
July 4th, 2005, 06:20 PM
Well, it seems the big problem I was having, I've licked!!!! So there isn't a need anymore for this post BUT I'll tell you the trouble I was having so this may indeed help others.

What I was encountering was this: I had movieclip button functions(in a menu) that I was calling from the main timeline(i.e. _alphas and loadmovie) and when I attached an onClipEvent to make this menu scroll infinitely, the buttons wouldn't work. So this is why I was looking for a way to script it in the timeline.

WELL ... as it turns out, all I had to do was 'convert' my mc buttons so that they had a registration point and VOILA! A person could go insane from stuff like this. Anyway, I hope someone finds this useful.

Bufffy.


P.S. Here's the code for the infinite menu without an onClipEvent(thx suisei)


menu.onEnterFrame = function() {
xcenter=400;
var speed=.5/100;
var distance=_root._xmouse-xcenter;
this._x+=(distance*speed);
if (this._x > 0) this._x=-807;
if (this._x < -807) this._x=0;
}