Hi,

I've been testing how to get the x and y position of the Mouse when
outside the Stage when the SWF is embedded in an HTML, which obviously
is not easy. For now I am interested in getting the Mouse coordinates
when the mouse has been pressed inside the Stage (onMouseDown) and the
dragged out. When you do this and drag the Mouse outside the SWF
bounds you keep on getting the Mouse coordinates, which is excellent.
This works great in Firefox, but has some issues in Internet Explorer
(haven't tested in other browsers).

Now, in IE if you drag the Mouse UP and out of the SWF you will start
getting the desired results, but if you don't do it first you won't
get the coordinates when you have dragged the Mouse out of the Stage
bounds (LHS, RHS and bottom). Also, sometimes (if you play around a
lot) this will happen if you drag the mouse DOWN and out of the SWF.

After you have actually managed to get the corresponding behavior in
IE and then you let the Mouse go, the saga begins again.

Can anyone confirm this behavior in IE?
Can anyone explain this behavior in IE?
Can anyone solve this behavior in IE?


Here's some sample code you can try out:

createTextField ("output1", 1, 100, 22, 200, 22).text = "Not testing
mouse x and y position";
createTextField ("output2", 2, 100, 44, 200, 22).text = "0 x 0";
createTextField ("output3", 3, 100, 66, 200, 22).text = "Mouse is
outside the SWF bounds: false";

function onMouseDown()
{
   output1.text = "Testing mouse x and y position";
}

function onMouseUp()
{
   output1.text = "Not testing mouse x and y position";
}

function onMouseMove()
{
   output2.text = _xmouse + " x " + _ymouse;
   output3.text = "Mouse is outside the SWF bounds: " + ( _xmouse < 0
|| _xmouse > Stage.width || _ymouse < 0 || _ymouse > Stage.height );
}
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to