hitTest working, but acting weird (MC as button)

I was playing around last night trying to learn simple AS to make a movie clip act like a button. I wanted the button movie clip to reduce the alpha value of the other movie clip when you rollover the button and when you roll off the button the alpha of the movie clip goes back up. It works, but if you keep rolling over and out of the button movieclip sometimes the alpha gets stuck at a certain value for a bit, then does what its supposed to. Any ideas why? I’m using onEnterFrame () to do the hitTest constantly.


Here’s the SWF and FLA files for you to look through:

hitTest SWF
hitTest FLA

Here’s the AS code I used in the frame to do this:

onEnterFrame = function() {
	if ( background._alpha > 100 ) {
		background._alpha = 100;
	if ( background._alpha < 0 ) {
		background._alpha = 0;
	if (hitTest( _root._xmouse, _root._ymouse, true)) {
	background._alpha -=25;
	else if (hitTest( _root._xmouse, _root._ymouse, false)) {
	background._alpha +=25;