[Flashcoders] detecting when mouse goes outside of the flash

2005-11-23 Thread Martin Klasson

Hi coders.

This has been up before, and I have done some own tests and searched the
archives as well.

But I can't find the solution, if there is any.

I want a certain thing to happen in my flash when the mouse moves
outside flash. Since the _xmouse/_ymouse stops updating when dragged
outside you cant rely on them (they do work WHEN mouse is pressed and
dragged out from the swf, but that is of course not a solution)

I have also tried to add a big 'button' which has onRollOut/onDragOut
attached to it, but the problem is that button-events above it will
disable the underlying one.

So what I know of there is no solution to this problem, but probably
some decent hacks?

I am not interested in a solution which requires code in the html-page
or so, but if you have such one I would like to know about it as well.

But mainly I wish to know a solution in which flash internally can say
if the mouse-cursor is outside the flash in the html-page.

Thanks Coders

/ martin
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] detecting when mouse goes outside of the flash

2005-11-23 Thread Campbell Anderson
P.S. to make it more reliable (but I realise you not happy with using
browser code...would be to surrond the flash movie with a div and have a
javascript listen for a on mouseover and call an fscommand or
externalinterface call (depending on the version of flash).

c.

 
 Hi coders.
 
 This has been up before, and I have done some own tests and searched the
 archives as well.
 
 But I can't find the solution, if there is any.
 
 I want a certain thing to happen in my flash when the mouse moves
 outside flash. Since the _xmouse/_ymouse stops updating when dragged
 outside you cant rely on them (they do work WHEN mouse is pressed and
 dragged out from the swf, but that is of course not a solution)
 
 I have also tried to add a big 'button' which has onRollOut/onDragOut
 attached to it, but the problem is that button-events above it will
 disable the underlying one.
 
 So what I know of there is no solution to this problem, but probably
 some decent hacks?
 
 I am not interested in a solution which requires code in the html-page
 or so, but if you have such one I would like to know about it as well.
 
 But mainly I wish to know a solution in which flash internally can say
 if the mouse-cursor is outside the flash in the html-page.
 
 Thanks Coders
 
 / martin
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
 

-- 

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


RE: [Flashcoders] detecting when mouse goes outside of the flash

2005-11-23 Thread Campbell Anderson
Yep was wondering if you had tried.sorry its the only answer I know of. 

c.

 
 Thanks Campbell.
 
 That code is though what I try to avoid, since it isn't 100% accurate.
 A quick move with the mouse and the code won't really detect that the
 cursor has left the flash area.
 
 The javascript-suggestion is nice of course, I have thought about that,
 but since it is a CMS and so on, it might not be an easy way to deal
 with that kind of implementation.
 
 Thanks anyway. To bad that their isn't a Stage.isMouseOver/out property.
 I thought macromedia would have made a solution to this somehow, since
 this has been a 'problem' since flash5. 
 
 / martin
 
 
 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] On Behalf Of Campbell
 Anderson
 Sent: den 23 november 2005 11:14
 To: Flashcoders mailing list
 Subject: Re: [Flashcoders] detecting when mouse goes outside of the
 flash
 
 P.S. to make it more reliable (but I realise you not happy with using
 browser code...would be to surrond the flash movie with a div and have a
 javascript listen for a on mouseover and call an fscommand or
 externalinterface call (depending on the version of flash).
 
 c.
 
  
  Hi coders.
  
  This has been up before, and I have done some own tests and searched
 the
  archives as well.
  
  But I can't find the solution, if there is any.
  
  I want a certain thing to happen in my flash when the mouse moves
  outside flash. Since the _xmouse/_ymouse stops updating when dragged
  outside you cant rely on them (they do work WHEN mouse is pressed and
  dragged out from the swf, but that is of course not a solution)
  
  I have also tried to add a big 'button' which has onRollOut/onDragOut
  attached to it, but the problem is that button-events above it will
  disable the underlying one.
  
  So what I know of there is no solution to this problem, but probably
  some decent hacks?
  
  I am not interested in a solution which requires code in the html-page
  or so, but if you have such one I would like to know about it as well.
  
  But mainly I wish to know a solution in which flash internally can say
  if the mouse-cursor is outside the flash in the html-page.
  
  Thanks Coders
  
  / martin
  ___
  Flashcoders mailing list
  Flashcoders@chattyfig.figleaf.com
  http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
  
  
 
 -- 
 
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
 

-- 

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] detecting when mouse goes outside of the flash

2005-11-23 Thread Marc Hoffman
I never found a good solution, either, without using code in the HTML 
page. I even tried setting a clip to look for the mouse and execute a 
function if the mouse wasn't found, but that failed (for reasons you explain).


If you can keep your buttons away from the edges of the movie, you 
can use an underlying button or an onMouseMove action to detect when 
the mouse is in that marginal area. You need a fast enough frame rate 
so the mouse position is captured during the time it passes over the 
marginal area. Someone with very fast mouse movement will probably be 
able to defeat this.


Marc

At 01:10 AM 11/23/2005, you wrote:


Hi coders.

This has been up before, and I have done some own tests and searched the
archives as well.

But I can't find the solution, if there is any.

I want a certain thing to happen in my flash when the mouse moves
outside flash. Since the _xmouse/_ymouse stops updating when dragged
outside you cant rely on them (they do work WHEN mouse is pressed and
dragged out from the swf, but that is of course not a solution)

I have also tried to add a big 'button' which has onRollOut/onDragOut
attached to it, but the problem is that button-events above it will
disable the underlying one.

So what I know of there is no solution to this problem, but probably
some decent hacks?

I am not interested in a solution which requires code in the html-page
or so, but if you have such one I would like to know about it as well.

But mainly I wish to know a solution in which flash internally can say
if the mouse-cursor is outside the flash in the html-page.

Thanks Coders

/ martin



___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] detecting when mouse goes outside of the flash

2005-11-23 Thread Gregory_GOusable

I'd suggest to use 1-pixel frame (maybe invisible) movieclip. Even
better - 2 such frames,- say, 1 and 2 px from the edge of the stage.
Then it can work as follows:

1) If mouse crosses one of frames, check (setInterval or onEnterFrame) if
it'll cross other right after this. Then:
2) If inner-then-outer = likely it goes outside;
   if outer-then-inner = likely it came back.
3) You can use vars (boolean) like hasCrossedInner etc.

Hope this can help.

-- 
Best regards,
 Gregory_GOusable

http://GOusable.com
Flash components development.
Usability services.

At 10:10 AM 11/23/2005, Martin Klasson wrote:

Hi coders.

This has been up before, and I have done some own tests and searched the
archives as well.

But I can't find the solution, if there is any.

I want a certain thing to happen in my flash when the mouse moves
outside flash. Since the _xmouse/_ymouse stops updating when dragged
outside you cant rely on them (they do work WHEN mouse is pressed and
dragged out from the swf, but that is of course not a solution)

I have also tried to add a big 'button' which has onRollOut/onDragOut
attached to it, but the problem is that button-events above it will
disable the underlying one.

So what I know of there is no solution to this problem, but probably
some decent hacks?

I am not interested in a solution which requires code in the html-page
or so, but if you have such one I would like to know about it as well.

But mainly I wish to know a solution in which flash internally can say
if the mouse-cursor is outside the flash in the html-page.

Thanks Coders

/ martin


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] detecting when mouse goes outside of the flash

2005-11-23 Thread David Rorex
The problem with all these look for mouse within 1 to 2 pixels of the
border solutions, is that moving the mouse, even at a moderate speed,
makes it move by 10 or more pixels at a time.

-David R

On 11/23/05, Gregory_GOusable [EMAIL PROTECTED] wrote:

 I'd suggest to use 1-pixel frame (maybe invisible) movieclip. Even
 better - 2 such frames,- say, 1 and 2 px from the edge of the stage.
 Then it can work as follows:

 1) If mouse crosses one of frames, check (setInterval or onEnterFrame) if
 it'll cross other right after this. Then:
 2) If inner-then-outer = likely it goes outside;
if outer-then-inner = likely it came back.
 3) You can use vars (boolean) like hasCrossedInner etc.

 Hope this can help.

 --
 Best regards,
  Gregory_GOusable
 
 http://GOusable.com
 Flash components development.
 Usability services.

 At 10:10 AM 11/23/2005, Martin Klasson wrote:

 Hi coders.
 
 This has been up before, and I have done some own tests and searched the
 archives as well.
 
 But I can't find the solution, if there is any.
 
 I want a certain thing to happen in my flash when the mouse moves
 outside flash. Since the _xmouse/_ymouse stops updating when dragged
 outside you cant rely on them (they do work WHEN mouse is pressed and
 dragged out from the swf, but that is of course not a solution)
 
 I have also tried to add a big 'button' which has onRollOut/onDragOut
 attached to it, but the problem is that button-events above it will
 disable the underlying one.
 
 So what I know of there is no solution to this problem, but probably
 some decent hacks?
 
 I am not interested in a solution which requires code in the html-page
 or so, but if you have such one I would like to know about it as well.
 
 But mainly I wish to know a solution in which flash internally can say
 if the mouse-cursor is outside the flash in the html-page.
 
 Thanks Coders
 
 / martin


 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] detecting when mouse goes outside of the flash

2005-11-23 Thread Marc Hoffman

A 1-pixel wide area is not likely to capture a rollOver.

Here's a .swf to test how wide a button needs to be to capture a rollOver:
http://www.dartfrogmedia.com/buttonTest

- Marc


At 10:42 AM 11/23/2005, you wrote:


I'd suggest to use 1-pixel frame (maybe invisible) movieclip. Even
better - 2 such frames,- say, 1 and 2 px from the edge of the stage.
Then it can work as follows:

1) If mouse crosses one of frames, check (setInterval or onEnterFrame) if
it'll cross other right after this. Then:
2) If inner-then-outer = likely it goes outside;
   if outer-then-inner = likely it came back.
3) You can use vars (boolean) like hasCrossedInner etc.

Hope this can help.

--
Best regards,
 Gregory_GOusable

http://GOusable.com
Flash components development.
Usability services.

At 10:10 AM 11/23/2005, Martin Klasson wrote:

Hi coders.

This has been up before, and I have done some own tests and searched the
archives as well.

But I can't find the solution, if there is any.

I want a certain thing to happen in my flash when the mouse moves
outside flash. Since the _xmouse/_ymouse stops updating when dragged
outside you cant rely on them (they do work WHEN mouse is pressed and
dragged out from the swf, but that is of course not a solution)

I have also tried to add a big 'button' which has onRollOut/onDragOut
attached to it, but the problem is that button-events above it will
disable the underlying one.

So what I know of there is no solution to this problem, but probably
some decent hacks?

I am not interested in a solution which requires code in the html-page
or so, but if you have such one I would like to know about it as well.

But mainly I wish to know a solution in which flash internally can say
if the mouse-cursor is outside the flash in the html-page.

Thanks Coders

/ martin


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders



___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] detecting when mouse goes outside of the flash

2005-11-23 Thread Kalle Thyselius, inlovewith
i did something in javascript that sent the data into flash
onMouseMove, which worked very well. especially if the flash movie is
on a fixed position.

i can't seem to find the code now though.

kalle


On 11/23/05, Marc Hoffman [EMAIL PROTECTED] wrote:
 A 1-pixel wide area is not likely to capture a rollOver.

 Here's a .swf to test how wide a button needs to be to capture a rollOver:
 http://www.dartfrogmedia.com/buttonTest

 - Marc


 At 10:42 AM 11/23/2005, you wrote:

 I'd suggest to use 1-pixel frame (maybe invisible) movieclip. Even
 better - 2 such frames,- say, 1 and 2 px from the edge of the stage.
 Then it can work as follows:
 
 1) If mouse crosses one of frames, check (setInterval or onEnterFrame) if
 it'll cross other right after this. Then:
 2) If inner-then-outer = likely it goes outside;
 if outer-then-inner = likely it came back.
 3) You can use vars (boolean) like hasCrossedInner etc.
 
 Hope this can help.
 
 --
 Best regards,
   Gregory_GOusable
 
 http://GOusable.com
 Flash components development.
 Usability services.
 
 At 10:10 AM 11/23/2005, Martin Klasson wrote:
 
  Hi coders.
  
  This has been up before, and I have done some own tests and searched the
  archives as well.
  
  But I can't find the solution, if there is any.
  
  I want a certain thing to happen in my flash when the mouse moves
  outside flash. Since the _xmouse/_ymouse stops updating when dragged
  outside you cant rely on them (they do work WHEN mouse is pressed and
  dragged out from the swf, but that is of course not a solution)
  
  I have also tried to add a big 'button' which has onRollOut/onDragOut
  attached to it, but the problem is that button-events above it will
  disable the underlying one.
  
  So what I know of there is no solution to this problem, but probably
  some decent hacks?
  
  I am not interested in a solution which requires code in the html-page
  or so, but if you have such one I would like to know about it as well.
  
  But mainly I wish to know a solution in which flash internally can say
  if the mouse-cursor is outside the flash in the html-page.
  
  Thanks Coders
  
  / martin
 
 
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders



--
inlovewith.com
inlovewith ltd.
kalle thyselius
linnégatan 76, stockholm, sweden
+ 46 707 602 600
inlovewith you
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders