views:

55

answers:

1

I have a few swf's that are loaded into a base file using levels. These clips can be cycled through by means of a setInterval function or when the user clicks the next or previous button. However, when the user hovers over a defined 'hit' area which is ultimately a blank movie clip, the setTimeout call is then canceled. This works fine, except that now the 'hit' clip - being above everything - prevents the movies below accepting hit states, and if I move it to below everything else, when one mouses over any element in the loaded movie, it then acts as though the user has mouse out of the hit area.

Is there any way to have this 'hit' clip do its job simply by determining if the mouse is over it, but without using an onRollOver function or equivalent?

Much appreciated

+1  A: 

Is there any way to have this 'hit' clip do its job simply by determining if the mouse is over it, but without using an onRollOver function or equivalent?

clip.hitTestPoint(mouseX, mouseY);

"Evaluates the display object to see if it overlaps or intersects with the point specified by the x and y parameters."

EDIT: Sorry, but I didn't notice the as2 tag, and the answer was in as3. It doesn't change much in as2, but there isn't a hitTestPoint, so you have to make it with a simple hitTest, like:

clip.hitTest(_xmouse, _ymouse);
dome
this looks promising, thanks for posting!
webfac
Ok this code was not working as smoothly as I had hoped, but his may have been due to how my code was written - who knows - so I played around and ended up determining the location of the mouse and performing conditional statements thereon. For other peoples benefits here's the procedure I followed:onMouseMove = function(){ if(_xmouse > 30 }else{ clearTimeout(mytime); mytime = setTimeout(slideshow,5000); }}Your code pointed me in the direction, so it deserves best answer, thank you.
webfac