Ok, so I'm having some issues with movieclip instance names in AS3.
Here's basically what's going on:
Making a small TD game. The basic turret movieclip is a drawn base, with the part that shoots as it's own movieclip (inside the whole thing). That is named "Top".
Now, all towers are inside one giant movieclip called "Towers". I have a mouse down even listener setup, to select whichever tower. So I tried this:
private function UpdateTowerSelection(e:MouseEvent){
trace (e.target.name);
}
When I click on the part of the tower movieclip that is just drawn there, I get:
instance##
Which I should get, it's just a name assigned to that moveclip, since I didn't assign any name to it. But, when I click on the shooting part of the turret (which I named "Top" through the Flash IDE), I get the same thing (different numbers).
Eh? I don't know why this is happening. I should get "Top", instead of "instance##". When I stick the "trace(name)" inside the "Top" movieclip, I do get the right thing: "Top"
In the class for the Turret movieclip (parent of the "Top" movieclip) it has plenty of lines with "Top.whatever" and whatnot, and it all works fine. As soon as I change it from "Top" to something else, it gives me an error.
But the "e.target.name" seems to bugged or something, because it actually was working before. I tweaked some things, but that shouldn't have done anything (no hierarchy change)
I have no idea what is going on.. help?
PS: Sorry if I didn't explain well.. I'm not too good at that :(