Hi, I have 2 MC and I want them to move each time I press them.
But I need to move them one a a time and not both of them at the same time as happens with this code.
[AS]
shot = function (x, y) {
_x += x;
_y += y;
};
for (i = 1; i < 3; i++) {
eval(“ball” + i).onPress = function() {
x = Math.floor(-2 + Math.random() * 4 + 1);
y = Math.floor(-2 + Math.random() * 4 + 1);
this.onEnterFrame = function() {
shot(x, y);
};
};
}
I also want that, if one of them collides the other, to stop moving.
Thanks.