thanks to you guys iv gotten hittest to work on me and my friends sites, but with olny one button for the MC to check for. Very simply, how do i get it to check for 2 or more?
Sorry no flash with me, so what code did you use? Try the ‘&&’ thing, although i’ve never used it before :-\
hehe, weird. i just found the && thing and tryed it. no luck. im not really sure what the syntax is for that or arrays which im fooling around with now. also, i accidently made the second “button” a MC in my fla, but that can be easy fixed.
Well i usually never use buttons, even if they act as ‘buttons’, i still keep em as MC’s…I’ll have a look at your fla now. It may or may not work :-\
EDIT: just looked at it…you want the mouse to hitTest both the blue boxes?? Thats not possible cause they’re not overlapping each other. Your mouse can only be at one place at a time…
Ok here it is. I changed the darker blue button’s instance name to ‘btn2’, because you shouldn’t start instance names or variables with a number…
This can probably be shorter i dunno :-\
[AS]
onClipEvent (enterFrame) {
if (_root.btn.hitTest(_root._xmouse, _root._ymouse, true)&& _root.btn2.hitTest(_root._xmouse, _root._ymouse, true)) {
this.nextFrame();
} else {
this.prevFrame();
}
}
[/AS]
oh yea you havta make the btns overlap at one point or it’ll never work
i got it to work using the “||” insted or the “&&”. does anyone else know of an easier way?
Put your buts in one mc and hitTest that
this way you wouldn’t need the
Button.prototype.hitTest = MovieClip.prototype.hitTest;