Solved

ActionScript 3: Return if cursor in bottom

Posted on 2010-11-16
2
368 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
2 Comments
 
LVL 10

Accepted Solution

by:
Carnou earned 500 total points
Comment Utility
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
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

This article describes a solution to a problem of subloading one movie into another when they have different SWF versions. Sometime back, I was working on an ActionScript project while I came across an interesting fact which I would like to share…
In my long career of working as an actionscript developer, I had spent sleepless night often working hard to solve some small problems which actually took a lot of my development time; later found out the solutions to be a line or two. Here are s…
In this tutorial viewers will learn how to create a basic motion tween animation in Flash Open a new document in Flash: Draw/import an image: Press CTRL + F8 to convert it into a graphic symbol: Select a frame (how long you want the tween to last): …
The goal of the tutorial is to teach the user how to select which audio input to use. Once you have an audio input plugged into the laptop or computer, you will go into the audio input settings and choose which audio input you want to use.

771 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now