It works exept i would like to click on a tower, and be able to upgrade separate towers. If i trace towerID outside of this function, it traces whichever tower was last.
The code for that is here:
this[name].onPress = function() { trace(towerID); } } This should make it so when i click on any tower, it traces the towerID. The problem is when i click on a tower, it traces whatever the last towers name was, because the towerID variable is newly asigned every time you place a new tower.
When I needed a bullet to take the direction I was aiming and tried this in the main time line, let's say I shoot at upper left and then at upper right, the upper left one would change it's direction when the other was shot
So I programmed inside the bullet and each one takes it's own direction