For move an MovieClip, we can use this code:
onClipEvent (enterFrame) {
_x+=5;
} , so i´w like stop de movieclip in a place (for example: in _x=500)
but, for example i put
onClipEvent (enterFrame) {
_x+=5;
if (_x=500) {
stop();
}
} the moving is not good. I´m sorry for my explain, so i do´nt speak english
ók first!
** “=” assigns a value to a variable and “==” checks the value **
so if you want to check the position then you should use “==”
e.g. if(_x**==**50) {}
and if you want to assign a value the you have to use “=”
e.g. this._x = 50;
and first you should know the way the object is moving!
to detect if its Xpos if more or less than 50
in this case it should be more so use
if(_x**>=**50) {
stopaction
}
because the objects Xposition is increased by 5 every frame and it may not be exactly 50 at any time.
and for the stop action do not use stop(). stop(); stops the timeline from playing. but use _x = 50;
so the last code should be:
if(_x>=50) {
// we check if the _x is more or equal to 50
_x = 50
//we make the xpos 50 so it'll stay at 50
}