Cita:
onClipEvent (load) {
origWidth = this._width;
//Duplicate the slider_mc for looping
duplicateMovieClip(this.slider, "slider2", 2);
this.slider2._x = origWidth;
duplicateMovieClip(this.slider, "slider3", 3);
this.slider3._x = -origWidth;
origX = this._x;
moveMenu = 0;
setWidth = this._width/3;
goRight = true;
stageWidth = Stage.width;
speed = 200;
}
onClipEvent (enterFrame) {
moveMenu = (Math.abs(stageWidth/2-_root._xmouse))/speed;
if (this._x-moveMenu<=origX-setWidth) {
this._x = this._x+setWidth;
} else if (this._x+moveMenu>=origX+setWidth) {
this._x = this._x-setWidth;
}
if (_root._xmouse<stageWidth/2) {
goRight = false;
this._x += moveMenu;
} else if (_root._xmouse>stageWidth/2) {
goRight = false;
this._x -= moveMenu;
}
}
origWidth = this._width;
//Duplicate the slider_mc for looping
duplicateMovieClip(this.slider, "slider2", 2);
this.slider2._x = origWidth;
duplicateMovieClip(this.slider, "slider3", 3);
this.slider3._x = -origWidth;
origX = this._x;
moveMenu = 0;
setWidth = this._width/3;
goRight = true;
stageWidth = Stage.width;
speed = 200;
}
onClipEvent (enterFrame) {
moveMenu = (Math.abs(stageWidth/2-_root._xmouse))/speed;
if (this._x-moveMenu<=origX-setWidth) {
this._x = this._x+setWidth;
} else if (this._x+moveMenu>=origX+setWidth) {
this._x = this._x-setWidth;
}
if (_root._xmouse<stageWidth/2) {
goRight = false;
this._x += moveMenu;
} else if (_root._xmouse>stageWidth/2) {
goRight = false;
this._x -= moveMenu;
}
}