I’m creating a game sort of thing. I’ve got a targeting movie (tag) clip that replaces the cursor. The idea is, when the targeting mc hitTests a movie clip inside another movie clip (zombie.head), and you click the mouse button, an animation plays. But the weird thing is, if you run the target across the head movie clip, move it away and then click the button, the animation still plays.
Here’s my code:
ActionScript Code:
[FONT=Courier New][LEFT]tag.[COLOR=#0000FF]onMouseMove[/COLOR] = [COLOR=#000000]function[/COLOR]COLOR=#000000[/COLOR] [COLOR=#000000]{[/COLOR]
tag.[COLOR=#0000FF]_x[/COLOR] = [COLOR=#0000FF]_xmouse[/COLOR];
tag.[COLOR=#0000FF]_y[/COLOR] = [COLOR=#0000FF]_ymouse[/COLOR];
[COLOR=#0000FF]updateAfterEvent[/COLOR]COLOR=#000000[/COLOR];
[COLOR=#0000FF]if[/COLOR] COLOR=#000000[/COLOR] [COLOR=#000000]{[/COLOR]
gunListener.[COLOR=#0000FF]onMouseDown[/COLOR] = blastEm;
[COLOR=#000000]}[/COLOR]
[COLOR=#000000]}[/COLOR];
[/LEFT]
[/FONT]
When I place the hitTest code outside of the onMouseMove function, then it doesn’t work at all. Any one have any ideas on how to make it work properly?