PDA

View Full Version : defining hit area


gristy
11-18-2005, 02:35 AM
i have a movieclip on which i have the following code

onClipEvent (enterFrame) {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
this.nextFrame();
} else {
gotoAndPlay(1);
}
}

when the mouse rolls over any part of the movieclip it plays

can i make it so only when it rolls over a certain graphic in the movieclip it plays?

CyanBlue
11-18-2005, 02:45 AM
Howdy... :)

This would be the easiest example I could come up with...

gristy
11-18-2005, 12:21 PM
thank you so much!!!! :D :D :D

gristy
11-18-2005, 02:13 PM
ok so this works,

but now i need to make it a button - if i try and put an invisible button underneath the movieclip the button doesnt work, if i put it on top, the animation doesnt play...

can i assign button functions to movieclips?
i want to put this on the movieclip:

on(release){
stopAllSounds();
secondSound.stop("secondSound");
thirdSound.start("thirdSound");
firstSound.stop("firstSound");
}

gristy
11-19-2005, 12:46 AM
many thanks cyan blue,

ive worked it out now, i added...

this.box_mc.circle_mc.onRelease = function ()
{
stopAllSounds();
_root.secondSound.stop("secondSound");
_root.thirdSound.stop("thirdSound");
_root.firstSound.start("firstSound");
}

...

to your frame actions.

THANKS AGAIN!