virror
267 posts
|
I can’t figure this out.
In my game i only had one enemy to test with, but now i added another one.
The problem is that when i click on it with my mouse and i have a EventListener(MouseEvent.CLICK, attack);
If i trace e.target, were e is e:MouseEvent i get [object slime_76] for one enemy, and [object MovieClip] for the other, the thing is that both enemies is from the same MovieClip “monsters” and are only different MovieClips in different frames.
Why are they not the same?
Does it make a difference if one MovieClip consists of other MovieClips and the others just taken from a MovieClip thats drawn directly?
|
Moonkey
1007 posts
|
e.target will give you whatever child MovieClip you clicked on. e.currentTarget will work better, it gives you whatever dispatched the event.
|
virror
267 posts
|
Thanx, that was alot better, will remember that : )
|