Hi everyone.
I’m trying to set up a script which would force an object to move through the stage untill a particular point and than change direction.
i wrote something like that:
onClipEvent (enterFrame) {
moveUp = function () {
this._y -= 1;
if (this._y<-30) {
this.onEnterFrame = moveDown;
}
};
moveDown = function () {
this._y += 1;
if (this._y>600) {
this.onEnterFrame = moveUp;
}
};
this.onEnterFrame = moveUp;
}
but it doesn’t work. the object moves only one direction and does not change it.
if enybody can see any error, please help!
thank you for your attention.