Hey guys, back with more moving using AS problems.
All I want to do is for a MC to move to a certain x when I click on it. Thats IT. But flash has all these restrictions on clip events and on handlers and stuff; it makes it really hard. So I have this code on the main timeline:
MovieClip.prototype.xmove = function(targetx, side, speed) {
this.onEnterFrame = function() {
if (side = "left") {
while (this._x > targetx) {
this._x = this._x - speed;
}
}
else if (side = "right") {
while (this._x < targetx) {
this._x = this._x + speed;
}
}
};
};
and this on the MC I want to move:
on(release){
this.xmove(0, left, 1);
}
I just don’t see why this won’t work! All it does is teleport to the targetx! It doesn’t actually MOVE. I thought this would be simple. Help!