Link to home
Start Free TrialLog in
Avatar of hankknight
hankknightFlag for Canada

asked on

ActionScript 3: Return if cursor in bottom

If the cursor is within the bottom 25 pixels, I want to return.

I can get the number for the position of the bottom 25 pixels like this:
stage.stageHeight - 25

But I do not know how to get the number for where the cursor is.
public function hideControlBar(e:MouseEvent)
		{
			if( position_of_cursor > stage.stageHeight - 25 ) return;
			myTween = new Tween( controlCont, "y", Regular.easeInOut, 1, 26, .8, true );
			myTween.start();
		}

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Carnou
Carnou
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
what carnou said is correct.

you also have access to it in the MouseEvent, as e.stageX and e.stageY



public function hideControlBar(e:MouseEvent)
		{
			if( e.stageY > stage.stageHeight - 25 ) return;
			myTween = new Tween( controlCont, "y", Regular.easeInOut, 1, 26, .8, true );
			myTween.start();
		}

Open in new window