Hey Im trying to make a game similar to an RTS and I was wondering if it was possible to be able to select move clips while moving by clicking and dragging
for (i=0; i<4; i++) {
nano = this.attachMovie("ball", "ball"+i, this.getNextHighestDepth());
nano._x = Math.random()*(Stage.width-nano._width);
nano._y = Math.random()*(Stage.height-nano._height);
nano.onRelease = function() {
target = this;
this.gotoAndStop(2);
};
nano.onReleaseOutside = function() {
target = this;
this.gotoAndStop(2);
};
nano.onEnterFrame = function() {
if (dragging) {
if ((this._x+10>Math.min(click_x, posx)) and (this._x-10<Math.max(click_x, posx)) and (this._y+10>Math.min(click_y, posy)) and (this._y-10<Math.max(click_y, posy))) {
target = this;
this.gotoAndStop(2);
select = true;
} else {
if (!select) {
this.gotoAndStop(1);
}
}
if (select) {
selmovie.clear();
}
}
};
nano.gotoAndStop(1);
}
I have code in there now that allows me to select a unit before it starts moving but after I move it with the arrow keys it doesnt work anymore for some reason does anyone know why this is?