can you know when the mouse is inside or outside the pano??

Specific Q&A about the new Flash export
User avatar
Posts: 19
Joined: Wed Nov 01, 2006 9:16 pm
Location: lost angeles

Sat Sep 15, 2007 12:32 am

can you know when the mouse is inside or outside the pano??

would like to track the mouse, so when it is inside the pano, turn on a special mouse graphic, but when the pano is below but still inside the same flash movie, the mouse turns back into the regular mouse cursor.

anyone know if this is possible???

thanks n advance...
Posts: 8
Joined: Mon Apr 30, 2007 7:40 am

Wed Sep 26, 2007 1:00 am

I'm no actionscript expert but I made a game a while ago and just checked the position of the mouse on screen... I would think that would work. The code below just checks the x position, you'd need to expand it to check the 4 corners of the panorama to see if the mouse falls within it. There might be a better way, like I say I'm no expert.

In Flash8 there's some code in the help under addListener (Mouse.addListener method) it does a hit test so it relies on clicking the mouse but still might be helpful.

var mouseListener:Object = new Object();
mouseListener.onMouseMove = function() {
_x = _xmouse;
_y = _ymouse;

this.onEnterFrame = function() {
if(_xmouse < 500){

//some code to change the cursor, I'm sure I've seen some in the Flash help...
else {
//change it back