Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

ActionScript 3: Return if cursor in bottom

Posted on 2010-11-16
2
Medium Priority
?
377 Views
Last Modified: 2013-11-11
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

0
Comment
Question by:hankknight
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 10

Accepted Solution

by:
Carnou earned 2000 total points
ID: 34148661
I believe you're looking for:
position_of_cursor = stage.mouseY;

Every DisplayObject (including the stage) has a mouseX and mouseY property that says where within that object the mouse is.
0
 
LVL 19

Expert Comment

by:moagrius
ID: 34148695
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

0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
The goal of the tutorial is to teach the user how to use the auto adjust feature and what the different options do. When your video is not working right you can choose the auto adjust feature to help choose your settings.
The goal of the tutorial is to teach the user what frame rate is, how to control it and what effect it has on the video.

704 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question