Vivek,
It seems to be a bug in certain versions of the player. I dragged a TextArea
component onto the stage, named it "mouseText", and modified the code as
shown below. When I published the movie and opened the HTML container in
Firefox, then it worked correctly. However, the error persists in IE. (I'm
running Flash 8 authoring tool, Flash Player 8.5, and the latest versions of
both browsers on Win XP Pro.)
/*****************************************/
/ Modified code
var mouseListener:Object = new Object();
mouseListener.onMouseDown = function() {
trace("mouseDown x: " + _level0._xmouse);
trace("mouseDown y: " + _level0._ymouse);
mouseText.text += "mouseDown x: " + _level0._xmouse + "\n";
mouseText.text += "mouseDown y: " + _level0._ymouse + "\n";
updateAfterEvent();
};
mouseListener.onMouseUp = function() {
trace("mouseUp x: " + _level0._xmouse);
trace("mouseUp y: " + _level0._ymouse);
mouseText.text += "mouseUp x: " + _level0._xmouse + "\n";
mouseText.text += "mouseUp y: " + _level0._ymouse + "\n";
updateAfterEvent();
};
Mouse.addListener(mouseListener);
/****************************************/
Can anyone shed any more light on this? Are we just missing something, or is
this a bug?
Jim
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Vivek
lakhanpal
Sent: Tuesday, May 02, 2006 6:31 AM
To: Flashcoders mailing list
Subject: [Flashcoders] x, y coordinates when using Mouse Listener object
arenot giving correct output
Hi All,
I would like to get mouse coordinates i.e. xmouse & ymouse when user's click
in my flash file and I am using mouse listener for this.
The problem i encountered is as follow
I did left click on stage and got some x, y coordinates then without moving
my mouse i did right click at same place.
Now i moved my mouse to some other place in the file and did left click
there and and i got last x,y coordinates.
Which is wrong output.
Here is the code i am using in my flash file.
/************************************************************************/
// Create a mouse listener object
var mouseListener:Object = new Object();
mouseListener.onMouseDown = function() {
trace("mouseDown " + _level0._xmouse);
trace("mouseDown " + _level0._ymouse);
updateAfterEvent();
};
mouseListener.onMouseUp = function() {
trace("mouseUp " + _level0._xmouse);
trace("mouseUp " + _level0._ymouse);
updateAfterEvent();
};
Mouse.addListener(mouseListener);
/************************************************************************/
Please suggest me some solution to this problem.
Thanks,
Vivek
_______________________________________________
[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
_______________________________________________
[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