i think that im missing something simple, but i cant seem to find it and its starting to bug me. all im trying to do is create movement for a mc. i had it working on the mc with onClipEvents, but now im trying to transfer it to the frame and kinda make it call its on instance name. maybe this doesnt work at all.
on mc, unit2 (instance name) :
onClipEvent (load) {
_x = 5;
_y = 0;
speed = 50;
instance = "_root.unit"+_root.population;
_root.population += 1;
}
on (release) {
_root.selectUnit1 = instance;
_root.selectedUnit1 = true;
}
on main frame:
population = 1;
selectedUnit1 = false;
selectedUnit2 = false;
selectUnit1 = "none";
selectUnit2 = "none";
selectUnit1.onMouseDown = function() {
if ((_root.selectedUnit1 == true) and (Key.isDown(Key.CONTROL))) {
endX = _root._xmouse;
endY = _root._ymouse;
}
};
selectUnit1.onEnterFrame = function() {
_x += (endX-_x)/speed;
_y += (endY-_y)/speed;
if (_root.selectedUnit1 == true) {
this.selectRing._visible = true;
}
if (_root.selectedUnit1 == !true) {
this.selectRing._visible = false;
}
};
thanks