Mouse off stage
- Started
- Last post
- 14 Responses
- dbloc
is there a way to detect if the cursor has left the flash stage area?
- ********0
I'd like to know that
- dbloc0
*bump
- M0NEYCIDE0
only when elvis has left the building
- ********0
Funny...I was just working on something and it left me wondering the same thing.
I started thinking about trying this scenario:
I have my main stage, which is 500x500. Then I was thinking about putting another flash movie around this in a two pixel border. Then when a user leaves the main stage, and rolls over the border pixel stage, you would use a localConnection call back to the main stage that says it has left the main window.
check out this link for info on localConnection: http://www.adobe.com/cfusion/kno…
- caseyc0
Pretty sure it will only track if they drag out of the swf, and even then its dicey. Search google and I'm sure there are plenty of articles on it.
- ********0
trouble with using a 2 pixel strip is that your mouse will very likely skip over that strip and not hit it.
best way is detecting for any mouse movement on stage, and combining this with if the mouse is close to the edge, as these things would help show that the mouse is likely off stage... although it would depend on the focus of the users interaction, i.e if they were filling a form in flash, those conditions might make you think the mouse is off screen, when it isn't
- nUBBER0
hello give me your email and ill send you a .swf that does it.
- tomkat0
I'd like to know too cause I thought its not posssible
:)
- st33d0
Ever heard of Google?
- alloyd0
Create mc same dimensions as stage.
Create another empty mc, attach to mouse, set coords to mouse x and y using onMouseMove.
Use clip for hittest. Check to see if mouseAttachment hitTest stageDuplicate = T/F.
- st33d0
Use clip for hittest. Check to see if mouseAttachment hitTest stageDuplicate = T/F.
alloyd
(Jan 13 07, 06:52)Proof of concept?
http://www.robotacid.com/misc/of…
I think not.
(in the dev environment the text changes to 'out' using hitTest. On html - it doesn't work)
- ********0
Google?
- UndoUndo0
use JS to send info to the swf when the swf loses focus
- st33d0
I'm not sure the swf loses focus.
And if you Google this problem you get loads of people going.
"I can't solve this problem, am I fucked?"
Answer:
"You're fucked."
Did find a neat open source project for comms between Flash and JavaScript though. If someone's willing to give it a go. I should be finishing my A.I. library really.