I’ve made a Flash Web Page with a Movie Clip in it which is made of a long row of buttons, some of them are outside the Stage itself. I wanted this row of buttons to move from its center point to the left and to the right so that the client will be able to click all the buttons which exist on that Movie Clip.
To do that I wrote this Action Script code:
onClipEvent (enterFrame) {
if (_root._ymouse > 94 && _root._ymouse < 174) {
_root.yChange = Math.round(_root._ymouse-this._y);
_root.xChange = Math.round(_root._xmouse-this._-300);
_root.yMove = Math.round(_root.yChange/134);
_root.xMove = Math.round(_root.xChange/20);
this._y += _root.yMove;
this._x -= _root.xMove;
}
else {
_root.yChange = Math.round(this._y - 134);
_root.xChange = Math.round(this._x - 300);
_root.yMove = Math.round(_root.yChange/134);
_root.xMove = Math.round(_root.xChange/20);
this._x -= _root.xMove;
this._y -= _root.yMove;
}
}
Now when the Mouse is over the Movie Clip, the buttons start to move to the left or to the right, depends if I put the Mouse over the right side or the left side of the Movie Clip. But the problem is that the buttons keep moving towards the edge of the Stage without a stop and what I want is that when the Movie Clip reaches the last Button it will STOP. How do I write that in the code? Somebody knows how to do that?
Thanks in advance,
Itai
To do that I wrote this Action Script code:
onClipEvent (enterFrame) {
if (_root._ymouse > 94 && _root._ymouse < 174) {
_root.yChange = Math.round(_root._ymouse-this._y);
_root.xChange = Math.round(_root._xmouse-this._-300);
_root.yMove = Math.round(_root.yChange/134);
_root.xMove = Math.round(_root.xChange/20);
this._y += _root.yMove;
this._x -= _root.xMove;
}
else {
_root.yChange = Math.round(this._y - 134);
_root.xChange = Math.round(this._x - 300);
_root.yMove = Math.round(_root.yChange/134);
_root.xMove = Math.round(_root.xChange/20);
this._x -= _root.xMove;
this._y -= _root.yMove;
}
}
Now when the Mouse is over the Movie Clip, the buttons start to move to the left or to the right, depends if I put the Mouse over the right side or the left side of the Movie Clip. But the problem is that the buttons keep moving towards the edge of the Stage without a stop and what I want is that when the Movie Clip reaches the last Button it will STOP. How do I write that in the code? Somebody knows how to do that?
Thanks in advance,
Itai