Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / Flash / Flash Actionscript / November 2004



Tip: Looking for answers? Try searching our database.

Detect Mouse leaving swf stage area

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
speedlab1 - 24 Nov 2004 08:43 GMT
is there a way to detect when the mouse leaves the swf stage area in a browser?
as an example, if i were to mouse outside of the display window up to the URL
bar or just mouse off of the browser in it's entirety.
webforumsuser@macromedia.com - 24 Nov 2004 10:53 GMT
Well here's what I did...  The Stage object is funky and doesn't work properly
so I made an empty movie clip the width and height of the stage and gave it an
instance name of myMC.  I put a dynamic text box on the stage so that when the
mouse went out of bounds, text would be written to the text box... I gave the
dynamic text box a variable name of box.  Here's the code with the Stage object
commented out since I couldn't get it to work properly.  onMouseMove =
function() {     //stageBegX = Stage.width - Stage.width ;     //stageEndX =
Stage.width;     //stageBegY = Stage.height - Stage.height;     //stageEndY =
Stage.height;     stageBegX = myMC._width - myMC._width;     stageEndX = myMC._width;
    stageBegY = myMC._height - myMC._height;     stageEndY = myMC._height;
    if(_xmouse<=stageBegX) {         box = 'out of bounds left';     }
    if(_xmouse>=stageEndX) {         box = 'out of bounds right';     }
    if(_ymouse<=stageBegY) {         box = 'out of bounds top';     }
    if(_ymouse>=stageEndY) {         box = 'out of bounds bottom';     } }   I noticed that
this worked best with the following publish settings on the HTML tab...
Dimensions: Percent HTML Alignement: Default Scale: No Scale Flash Alignment:
Center, Center  Hope this helps!!! Brenda
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2012 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.