Flash CS3 - Flash CS4

Free tutorials and scripts for all.
Actionscript 3.0

Event.MOUSE_LEAVE

This is a discussion on Event.MOUSE_LEAVE within the Tutorials forums, part of the Flash English category; Greetings, There is an event available in Actionscript 3.0 that I didn"t take notice before: the event MOUSE_LEAVE. ...


Go Back   Forum Flash CS3 Flash CS4 > Flash CS3 Flash CS4 > Flash English > Tutorials

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  1 links from elsewhere to this Post. Click to view. #1 (permalink)  
Old 12-12-07, 06:44
Administrator
 
Join Date: Jul 2007
Location: Cesena
Posts: 4,535
Rep Power: 6
Flep is on a distinguished road
Event.MOUSE_LEAVE

Greetings,


There is an event available in Actionscript 3.0 that I didn"t take notice before: the event MOUSE_LEAVE.
This useful event allows to intercept the moment when the user"s mouse leaves the area defined by the SWF.
It is certainly important and useful when realizing animations based on the mouse coordinates and obviously, it will find its utility in more different type of applications.

I create a FLA and I save it as "main.fla".
Into which, I create a dynamic text field with an instance name "test_txt".

The code to use the event MOUSE_EVENT:
Code:
stage.addEventListener(Event.MOUSE_LEAVE,go);
function go(evt:Event):void
{
	test_txt.appendText('gone  ');
}
This event is only available added to the stage.

The result:






If we move the mouse outside the area defined by the SWF, Flash will now tell us so.

See you next!

Last edited by Flep; 28-08-08 at 06:34..
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

  #2 (permalink)  
Old 13-12-07, 16:13
Member
 
Join Date: Nov 2007
Posts: 59
Rep Power: 2
gwulfwud is on a distinguished road
Re: Event.MOUSE_LEAVE

a very useful one! thanks flep!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 13-06-08, 21:27
Junior Member
 
Join Date: May 2008
Posts: 1
Rep Power: 0
Florindustries is on a distinguished road
Re: Event.MOUSE_LEAVE

If I roll out of the box, it says "gone", but if I then click in the browser, every click will generate another "gone", even though I'm not over the flash movie anymore ..
Any ideas?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 14-06-08, 11:17
Administrator
 
Join Date: Jul 2007
Location: Cesena
Posts: 4,535
Rep Power: 6
Flep is on a distinguished road
Re: Event.MOUSE_LEAVE

I think cause of this forum board.
Did you try it with a simple html page ?
__________________

 


I recommend: Essential Actionscript 3.0

- I do not reply technicians pvt messages. Open a thread !
- Non rispondo ai messaggi privati con domande tecniche. Apri una discussione sul forum !
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 14-11-08, 13:10
Junior Member
 
Join Date: Jul 2008
Posts: 1
Rep Power: 0
pikus222 is on a distinguished road
Re: Event.MOUSE_LEAVE

This event isn't dispached when mouse pointer leaves stage while mouse button is pressed. If you realese mouse button outside the stage, then MOUSE_LEAVE event is fired. When you move cursor back to stage and then realese the button, then event isn't dispached at all.

Any clue how to handle dispaching MOUSE_LEAVE event with mouse button pressed??
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 19-11-08, 17:34
Administrator
 
Join Date: Jul 2007
Location: Cesena
Posts: 4,535
Rep Power: 6
Flep is on a distinguished road
Re: Event.MOUSE_LEAVE

hmmm very good point
__________________

 


I recommend: Essential Actionscript 3.0

- I do not reply technicians pvt messages. Open a thread !
- Non rispondo ai messaggi privati con domande tecniche. Apri una discussione sul forum !
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads

Thread Thread Starter Forum Replies Last Post
DOUBLE_CLICK event Flep Tutorials 1 01-12-08 03:18
dipatch event nootropic.kint Actionscript 3.0 avanzato 9 04-12-07 11:16
event lmarkus Flash Italiano 1 31-10-07 16:39
Event.MOUSE_LEAVE Flep Articoli e tutorials 5 26-10-07 18:59
mouse event in as 3 nootropic.kint Actionscript 3.0 base 11 03-08-07 10:18


All times are GMT. The time now is 18:19.

Powered by vBulletin version 3.7.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC4
Forum SiteMap