Avatar of hankknight
hankknight
Flag for Canada

asked on 

ActionScript 3: stage mouse out problem

I use the following ActionScript 3 functions to show and hide my controls:
public function showControlBar( e:MouseEvent )
		{
			if(controlBarStatus==1) return;
			else {
			 controlBarStatus=1;
			 myTween = new Tween( controlCont, "y", Regular.easeInOut, 25, 0, .7, true );
			 myTween.start();
			}
		}

		public function hideControlBar(e:MouseEvent)
		{
			if(controlBarStatus==0) return;
			controlBarStatus=0;
			controlCont.y=26;
		}

Open in new window


The controls should be shown when the cursor is over the movie and they should be hidden when the cursor is not over the movie.

I use this code to listen for the cursor position:
stage.addEventListener(MouseEvent.MOUSE_OVER,showControlBar);
stage.addEventListener(MouseEvent.MOUSE_OUT,hideControlBar);

Open in new window


The problem is that when I place my cursor over the controls, gets stuck in a loop of hiding the controls then showing them again.

I have attached the source code including the .swf, .fla and .as files.
MoviePlayer.zip
Adobe Flash

Avatar of undefined
Last Comment
hankknight

8/22/2022 - Mon