How would I make a hittest so that flash would detect when the mouse enters contact with the target and the target plays? I’ve attached the file I’ve been trying to do the mouse hittest with. Any help would be greatly appreciated.
Well, your cross hair is following the mouse, so one way you can do this is to check if the mouse is over using hitTest. On your target clip add these actions… [AS]onClipEvent(enterFrame){
if (this.hitTest(_root._xmouse, _root._ymouse, true)){
//do what you want when the mouse is over
}
}[/AS]
I tried what you told me, but it still doesnt seem to be working out.
It put the below script in my target movie clip
[AS]onClipEvent (enterFrame) {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
this.play;
}
}
[/AS]
and I put this script in the first fram where everything is located…this seems to be working fine…
[AS]startDrag ("/crosshair", true);
Mouse.hide();
[/AS]
And for some reason it doesn’t work…no errors just doesn’t work…I’ve attached the current fla. Also how would I make it work only when I press the mouse button so that it just doesn’t hit test when I mouse over??Help!!!
So close yet so far
this.play should be this.play() (the parenthesis make all the difference)
The little things can drive one nuts :hr:
aha! Thank you!:beam:Now it works…but it works as soon as I mouse over, how can I do it so it only works when I click on the target with the crosshair???
Bah… I thought you were trying to do it onRollOver… sorry. That method is a lot easier… Replace the current actions on the clip with [AS]onClipEvent (load) {
//don’t use the hand cursor when you are over the clip
this.useHandCursor = false;
}
on (press) {
//when you press, play the clip
this.play();
}[/AS]
YES!!! Thank you so much :beam:!! It works!!!
No problem