Mouse position wrong on Mac, OK on Windows

I have an air app that uses HTML5 and Javascript, and the drag and drop events.  On Windows, when the drag event fires, and then a drag is in progress, the mouse coordinates are consistent.  That is, if I click on an object, in the center, and check the X and Y, I get a number, and as I drag 1 pixel to the left and down, the X and Y update as expected.
On Mac OSx, when I start a drag, the X and Y are right, but when the drag is on progress, the X and Y are offset.  The offset appears to be equal to the bottom left corner of the object.
Specifically, if I have a 100x100 object in the center of a 1000 pixel stage, and I click on the middle, the dragstart event would have pageX and pageY properties of 500,500.  If I drag down and left 1 pixel, I would expect 499,501.  Instead, with the drag event, I get something close to  449,551.  On Air under Windows XP, I get the expect value.
Is this a bug in Air, or something I may be doing wrong?  I have tried various properties (screenX, pageX) with no luck.  I cannot seem to get stageX and stageY to work within javascript in HTML5.

I'm using just HTML5 and Javascript.  I am including sample code below.  I based it on the example here:  http://livedocs.adobe.com/flex/3/html/help.html?content=DragAndDrop_5.html.  Compile the example as an Air file, and run on PC and Mac.
In the example, I added an alert to display the X and Y coordinates when a drag event is in progress.  To see the problem, click on an obvious spot in the image, such as the upper-right corner of the "e" in "Once," and start dragging.  On a PC, you should get a value close to 225,212.  On a Mac, the value will be 44,312 (which corresponds to the lower left corner of the image).  If you add an alert to dragstart, you should see that the x and y for the start event are correct on both systems.
Thanks in advance for your help.
Noel
<html>
<head>
<title>Drag-and-drop</title>
<script language="javascript" type="text/javascript" src="AIRAliases.js"></script>
<script language="javascript">
    function init(){
        var target = document.getElementById('target');
        target.addEventListener("dragenter", dragEnterOverHandler);
        target.addEventListener("dragover", dragEnterOverHandler);
        target.addEventListener("drop", dropHandler);
        var source = document.getElementById('source');
        source.addEventListener("dragstart", dragStartHandler);
        source.addEventListener("dragend", dragEndHandler);
        source.addEventListener("drag", dragHandler);
        emptyRow = document.getElementById("emptyTargetRow");
    function dragStartHandler(event){       
        event.dataTransfer.effectAllowed = "copy";
    function dragHandler(event){       
alert(event.pageX + " " + event.pageY);
    function dragEndHandler(event){
        air.trace(event.type + ": " + event.dataTransfer.dropEffect);
    function dragEnterOverHandler(event){
        event.preventDefault();
    var emptyRow;
    function dropHandler(event){
        for(var prop in event){
            air.trace(prop + " = " + event[prop]);
        var row = document.createElement('tr');
        row.innerHTML = "<td>" + event.dataTransfer.getData("text/plain") + "</td>" +
            "<td>" + event.dataTransfer.getData("text/html") + "</td>" +
            "<td>" + event.dataTransfer.getData("text/uri-list") + "</td>" +
            "<td>" + event.dataTransfer.getData("application/x-vnd.adobe.air.file-list") +
            "</td>";
        var imageCell = document.createElement('td');
        if((event.dataTransfer.types.toString()).search("image/x-vnd.adobe.air.bitmap") > -1){
            imageCell.appendChild(event.dataTransfer.getData("image/x-vnd.adobe.air.bitmap"));
        row.appendChild(imageCell);
        var parent = emptyRow.parentNode;
        parent.insertBefore(row, emptyRow);
</script>
</head>
<body onLoad="init()" style="padding:5px">
<div>
    <h1>Source</h1>
    <p>Items to drag:</p>
    <ul id="source">
        <li>Plain text.</li>
        <li>HTML <b>formatted</b> text.</li>
        <li>A <a href="http://www.adobe.com">URL.</a></li>
        <li style="-webkit-user-drag:none;">
            Uses "-webkit-user-drag:none" style.
        </li>
        <li style="-webkit-user-select:none;">
            Uses "-webkit-user-select:none" style.
        </li>
        <li><img src="http://onceuponanapp.com/blog/wp-content/themes/OUAA_David/images/logo.png" alt="logo" class="logo-image"></li>
    </ul>
</div>
<div id="target" style="border-style:dashed;">
    <h1 >Target</h1>
    <p>Drag items from the source list (or elsewhere).</p>
    <table id="displayTable" border="1">
        <tr><th>Plain text</th><th>Html text</th><th>URL</th><th>File list</th><th>Bitmap Data</th></tr>
        <tr id="emptyTargetRow"><td> </td><td> </td><td> </td><td> </td><td> </td></tr>
    </table>
    </div>
</div>
</body>
</html>

Similar Messages

  • Hwo to "track the mouse position"

    I m a java newbie, and need to write a small program to track the mouse position.
    basically, it opens a small window, and tell you the current mouse x, y coordinate. when mouse moves, hte x, y changes...
    by the way, how can i compile it to .exe file, after i finished coding.
    i try this way, but so many errors.
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class mouseWin {
    public static void main(String[] args)
              protected int last_x=0, last_y=0;
              mouseMoved(MouseEvent e);
    JFrame frame = new JFrame("Mike's Mouse");
    JLabel X = new JLabel("x: " + last_x + "y: " + last_y);
    frame.getContentPane().add(X);
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.pack();
    frame.setVisible(true);
         public mouseMoved(mouseEvent e)
              last_x = e.getx();
              last_y = e.gety();

    please help.
    i rewrite the code, but still cannot get it work
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.util.EventListener;
    public class mouseWin implements MouseMotionListener
    public static void main(String[] args)
                   int last_x;
                   int last_y;
                   last_x = 0;
                   last_y = 0;
                   JFrame frame = new JFrame("Mike's Mouse");
                   JLabel X = new JLabel("x: " + last_x + "y: " + last_y);
              frame.getContentPane().add(X);
                   frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                   frame.pack();
                   frame.setVisible(true);
         public void mouseMoved(MouseEvent e)
              last_x = e.getx();
              last_y = e.gety();
              JLabel X = new JLabel("x: " + last_x + "y: " + last_y);
    }

  • Mouse position on screen

    is there any way to get the mouses position on the screen (not a window)?
    Stephen

    Component c = (Component)e.getSource();
    Point p = e.getPoint();
    SwingUtilities.convertPointToScreen(p, c);
    System.out.println(p);

  • My Macbook Pro has a black screen when running in Bootcamp Windows 7. Since I updated the mac side my windows side now starts up with completely black screen - no prompt, nothing, Cap keys still light up as does mouse and DVD drive seems to run.

    My Macbook Pro has a black screen when running in Bootcamp Windows 7. Since I updated the mac side my windows side now starts up with completely black screen - no prompt, nothing, Cap keys still light up as does mouse and DVD drive seems to run.
    Will not show up in safe mode, will not show when started from Windows 7 DVD.
    I suspect the Mac update wiped out my PC video drivers but can not think of a way to re-install?
    Can see the PC volume from Mac side with files.
    I've looked at all the online solutions so far and have tried most of them without success. Please help!
    Specs:
    2009 Macbook Pro, 3.06 GHz Intel 2 core, Max 10.6.8.
      Model Name:          MacBook Pro
      Model Identifier:          MacBookPro5,2
      Processor Name:          Intel Core 2 Duo
      Processor Speed:          3.06 GHz
      Number Of Processors:          1
      Total Number Of Cores:          2
      L2 Cache:          6 MB
      Memory:          4 GB
      Bus Speed:          1.07 GHz
      Boot ROM Version:          MBP52.008E.B05
      SMC Version (system):          1.42f4
      Serial Number (system):          7302300GANE
      Hardware UUID:          B2D4B4B4-CD92-5C7A-BDC2-527D30DD8DF3
      Sudden Motion Sensor:
      State:          Enabled

    EDIT: RESOLVED
    For anyone else who finds their way here like I did, this link did it for me: https://forums.geforce.com/default/topic/527599/windows-8-issues-solved-please-r ead-if-you-39-re-having-black-screen-and-or-flickering-/
    Specifically, the posts by Dunsany and valkyr did the trick.  I booted in safe mode, uninstalled and deleted the Nvidia driver, disabled automatic driver installation, and restarted normally.  I then manually downloaded and installed the previous Nvidia driver for my graphics card (which at the time of this writing was 335.23, rather than the latest which was 337.88), and everything is now bueno!
    Two hiccoughs along the way: First, when I tried to uninstall the Nvidia driver the first time, when I restarted I got the login screen (which was a good sign), but it quickly went black again.  I powered down, restarted in safe mode again, and repeated the uninstallation process, and it worked the second time.  Second, when I started the manual install of the 335.23 driver, the computer played a sound similar to the one for disconnecting a USB device, and the screen went black.  I'd seen a lot about trying to increase the brightness (though it hadn't worked up to this point; but if you haven't tried it yet, might as well); I tried it, and it worked! So far I'm back up and running. [/fingers crossed]
    Hope this helps someone else!

  • Zooming image from mouse position(like in  windows vista photo gallery)

    hello all;
    here's my situation, hope someone can help..
    i wanna Zoom an image, which zoom from my mouse position
    like in windows photo gallery in windows vista
    so i do this..
    g2.translate(iMoux,iMouy);       
            g2.scale(zoom, zoom);       
            g2.translate(-iMoux,-iMouy);       
            g.drawImage(icon.getImage(), iSposx, iSposx, d.width/2-iValue, d.height-iBawah, null);
            g.drawImage(icon2.getImage(), d.width/2, iSposy, d.width/2-iValue, d.height-iBawah, null);the problem come when i move my mouse to the different location (like from top right to bottom left)
    the zoom image displayed in the screen like jump from latest location to new location
    anybody can help me...a clue how to do that?
    thx appreciate your help guys
    mao
    Edited by: KingMao on 31 Mei 08 14:27

    Hi Frank.
    Thanks for the response.
    Agreed, the pertinent question is why can't my colleague edit the JPG exported by Aperture. It's probably also worth pointing out, the same problem occurs with JPGs exported from iPhoto.
    The Windows software usually plays nicely with JPGs by all acounts, just not the ones I send - which I do via eMail or my public space on Mobile Me incidently.
    So, another key question is: all settings being equal (color profile, quality, etc.) are the JPGs as produced by iPhoto and Aperture indistinguishable from those produced by other apps on other platforms - i.e. does the use of JPG enforce a common standard?
    If that is the case, I suspect ours might be a permissions issue.
    According to the Microsoft support page on editing in Windows Live Photo Gallery, the inability to edit a picture is commonly caused by unsupported file type, or read-only attribute set on the file.
    Unfortunately, he and I are not in the same place, and he's not particularly au-fait with this type of problem solving. Hence, before involving him, I'd like to know:
    1. it's possible (i.e. someone else does it), and,
    2. what's involved (at my end and/or his).
    Thanks again,
    PB

  • MAC OS X + stage.fullScreenSourceRect + renderMode set to GPU = problem with mouse position

    When setting stage.fullScreenSourceRect, stage.displayState to StageDisplayState.FULL_SCREEN_INTERACTIVE; and renderMode to GPU, mouse position is read incorrectly. This is not only for mouseX and mouseY position, but also all the mouse interactions with Sprites, Buttons etc are not working correctly.
    Anybody know a solution for this issue?
    Here is the bug reported, but there is no response yet.
    https://bugbase.adobe.com/index.cfm?event=bug&id=3486120
    Greg.

    Bump up.
    Anybody has the same problem and have an idea how to fix it? Or please just check if you have the same problem.. I'm going to submit my game "Amelia and Terror of the Night" (successfully added to iOS store) to MAC App Store but can't do it while this problem appears.
    I am disappointed nobody  even verified the bugs I submitted at  the bugbase.adobe.com for AIR 3.5 and 3.6
    thanks
    Greg

  • Track mouse position in Bookmark window.

    When the cursor moves to a bookmark window, it underlines the bookmark title and shape of the cursor also changes(say finger shape).
    Is there any callback function/some other way to track the change in cursor position when it is in Bookmark window,(means when it is moved to that window and moves over a bookmark) please tell me.
    thank you,
    palaksha

    No, there are no provided APIs to give you that level of information.
    Leonard

  • Can no longer share my Mac to my windows PC

    With 10.4, sharing my Mac to my windows PC was really easy. Now that I've installed 10.5, my PC can no longer see my mac's shared folders.
    When I try to map network drive to \\192.168.1.4\shared_folder (for example), my PC just gives me an error that the "network path could not be found."
    Yes, I read the online help and tried everything in "If you can’t connect to a Mac from a Windows computer"
    For some reason, the systems preferences will not let me set a workgroup for my mac. I type in the workgroup name for the mac, and click save, and then when I go back to look at it again, it doesn't appear to have saved the workgroup name I typed in. So, if the workgroup name is the problem, I can't appear to fix it. why isn't it saving this information?
    What the heck am I doing wrong?

    To set up file sharing:
    Choose Apple > System Preferences, and then click Sharing.
    Select the File Sharing checkbox.
    Users you have set up with accounts in Accounts preferences can access your computer by connecting to it over the network.
    To refine user access to your computer and set up specific folders or volumes to share, click Add {+} at the bottom of the Folders list and select the folder you want to share.
    To further refine user access, click Add {+} at the bottom of the Users list and select a user from Users & Groups (accounts you have set up in Accounts preferences), Network Users or your Address Book. Or click New Person and enter a name and password to create a sharing account. Select the user from the list and click Select.
    After the user is in the list, use the triangles next to the user name to assign privileges for that use user (No Access, Read & Write, Read Only, or Write Only (Drop Box)).
    Click Options and select the way you want to share your computer: using AFP, FTP, or SMB.
    If Windows users will connect to your computer to share files, make sure SMB is selected, select the On checkbox next to the name of the account that will share your computer, and enter the password for that user.
    Message was edited by: KJK555

  • Adobe creative cloud set up to install on a mac with parallels windows 8

    Unfortunately it is not possible to install the program it always displays an error message. how can you loess the problem?
    error message: This application can not be run from a network drive-. copy it to a local folder and strarten it again.

    I have just the regular version, not Professional.
    I mean "les integrated", in the sense that you really run Fusion "in a window". The more "integrated" approach means that Windows applications run as if they were for the Mac, and you do not see the Windows interface at all. I personnaly think tjat is too confusing. There is nothing wrong with it, just a bit more confusing. i like having it clear that Windows is in a seperate Window.
    Op 21 nov. 2013 om 12:57 heeft Krishnam <[email protected]> het volgende geschreven:
    Re: adobe creative cloud set up to install on a mac with parallels windows 8
    created by Krishnam in Adobe Creative Cloud - View the full discussion
    Hi MacLesNL,
    Which version of VM Ware should I go for?
    http://www.vmware.com/uk/products/fusion/
    http://www.vmware.com/uk/products/fusion-professional/
    So that I could install Adobe CC on Windows 7? Please advise.
    What do you mean ny "less integrated"? Is this must to run Adobe CC in VMWare on Mac?
    Please advise.
    Thanks, Krishnam
    Please note that the Adobe Forums do not accept email attachments. If you want to embed a screen image in your message please visit the thread in the forum to embed the image at http://forums.adobe.com/message/5861525#5861525
    Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: http://forums.adobe.com/message/5861525#5861525
    To unsubscribe from this thread, please visit the message page at http://forums.adobe.com/message/5861525#5861525. In the Actions box on the right, click the Stop Email Notifications link.
    Start a new discussion in Adobe Creative Cloud at Adobe Community
    For more information about maintaining your forum email notifications please go to http://forums.adobe.com/thread/416458?tstart=0.

  • How do I Connect both an iBook and Power Mac G5 to Windows XP Pro network?

    I have an existing Windows network at home, with a Motorola Surfborad Cable Modem, Linksys Wired Cable/DSL VPN Router with 5-port 10/100 switch (BEFVP41), Linksys Wireless G Access Point (WAP54G), Linksys Etherfast 10/100 Workgroup Switches (EZXS55W v3) and several connected devices including: two Windows Desktops (wired), a Humax TiVo (wireless), Two (2) SlimDevice Squeezeboxes (wireless), and a Microsoft X-Box game system.
    For some reason, I cannot successfully connect either a Power Mac G5 (wired) or an iBook (wireless) to the newtork and internet. In both cases, if I attempt to connect them, the router does appear to see them, but I can't get connection to the Internet.
    Also, if I try to access either the Router or the WAP via their respective Access URL's: http://10.0.1.1/ & http://10.0.1.2/ nothing happens.
    I have disconnected all the other connected devices and tried to connect them with no results.
    Re-starting the cable modem, router or WAP didn't help.
    If I connect one of the Windows PC's to the same cable I have tried unsuccessfully with the Power Mac, The Windows PC connects to both the Network and Internet immediately!
    Additionally, I have checked out the entire wiring system, which are Cat5E cables. This included re-checking all connectors and testing each wire run. All cables are "straight through" with no opens, shorts or cross0overs.
    I am sure that I am doing something wrong and that there is an "easy fix", but it's beyond my meager knowledge.
    If someone can supply me with "Step by Step", detailed instructions on how to accomplish this, please help me.
    Sincerely,
    Gordy in Reading, MA - USA
    Power Mac G5, iBook & Windows Compat's   Windows XP Pro   Windows XP Pro SP2, Windows Home Network, Comcast Broadband Internet, Linksys Network Harrdware
    Power Mac G5, iBook & Windows Compat's   Mac OS X (10.4)   Windows XP Pro SR2, Windows Home Network
    Power Mac G5, iBook & Windows Compat's   Mac OS X (10.4)   Windows XP Pro SR2, Windows Home Network
    Power Mac G5, iBook & Windows Compat's   Mac OS X (10.4)   Windows XP Pro SR2, Windows Home Network
    Power Mac G5, iBook & Windows Compat's   Mac OS X (10.4)   Windows XP Pro SR2, Windows Home Network

    Hi Gordy,
    Well, that's certainly some setup you've got there.
    Also, if I try to access either the Router or the WAP via their respective Access URL's: http://10.0.1.1/ & http://10.0.1.2/ nothing happens.
    I'm not sure about those URL's. Plug your PowerMac into the router , then launch Safari and type 192.168.1.100 in the address bar it should allow you to access the routers settings via the web-based utility. Please check and see if that much that works and post back.
    Jrsy

  • System not sensing mouse position

    Starting today, my computer (iMac G5 PPC) no longer senses the position of my mouse pointer. For instance:
    - The dock doesn't magnify when the mouse is in it
    - None of the corners activate things like screensaver, expose, desktop
    - When I select a menu in the menu bar, moving the mouse over another menu item doesn't open that menu.
    In other words, OSX simply has no clue where my mouse pointer is located as I move it for all those neat automatic things. Yet, I can still use the mouse to click on items to make them work, then OSX knows where the mouse is.
    I've rebooted several times to no effect, but did notice something. As apps start up, the instant a window opens, OSX will sense the mouse position for that brief moment. For example, putting the mouse over the dock doesn't magnify, but when an app window appears, the dock will magnify that very instance. Moving the mouse out of the dock area doesn't unmagnify the dock, it's stuck in that state until either another window opens, causing OSX to sense the new position, or I click any mouse button which all gets OSX's attention and senses the mouse position.
    The pointer never changes when I'm over things like Links.
    Strange stuff. The mouse moves fine, it's just not being detected as it moves.
    Now, yesterday I installed a new ScanSnap scanner with the ScanSnap Manager software and Acrobat Standard ver. 7. But the mouse didn't have this behavior yesterday, or even this morning. This strange problem just appeared out of the blue mid-day today.
    I've since used Disk Utility and Onyx, and re-installed the 10.4.9 update. I switched to another user account, no difference, so it's definitely system wide.
    This doesn't stop me from using my iMac, but I just don't know how to fix this mouse issue besides a OSX re-install.

    Ok everybody, I finally got proper behavior, it's just too bad I'm not sure of the procedure.
    When I go to bed I usually run the mouse pointer to the upper left corner to activate the screensaver. Of course it didn't work. But I also knew that clicking a button causes the mouse to be sensed, so I was pushing some of the buttons while in the corner to see if I could get the screensaver going.
    Well, after doing this, everything is back to normal operation again. So, I fixed it totally by accident. Makes me wonder if there's some features that are turned on and off somehow by doing whatever it was I did up in that corner.
    Just so you know, I use a Logitech Cordless Optical Trackman. I swapped to the original Apple corded mouse but that made no difference.
    I never had a chance to try the suggestions since I just read them before posting this.
    Anyway, I hope I don't do again whatever it was that caused the behavior, but I am going to store this info in DEVONthink just in case something like this happens again.
    Anyway, it would still be interesting if someone could shed some light on this fix I accidently found. Perhaps some hidden capabilities/features? Or just dumb luck?

  • How do i adjust from mac Gamma to Windows Gamma in Photoshop CS3?

    It was real easy in version 7, all i did is seelct mac to windows in adobe Image Ready. There is not program like that now in CS3...how to i adjust an image with a Mac gamma of 1.8 to the Windows Gamma of 2.2? i tried the convert to profile option, but when i select a gamma of 2.2 it goes all grey....HELP can someone tell me the exact steps??

    Computers, PCs or Macs, have no "gamma".
    zeno3333 wrote:
    Anyway, i found a photographers web site that has a layers file that converts from the Mac Gamma to the Windows gamma....
    Its at
    http://www.zuberphotographics.com/content/downloads/mac2windows.htm
    That Levels adjustment does the same thing as the Curves adjustments I suggested.  Curves are preferable to Levels, but that's a whole different chapter.
    zeno3333 wrote:
    Macs have different gammas than PCs....something that everyone here for some reason refused to get the reality of.
    With all respect, you are 100% in error, DEAD WRONG.  Macs used an 1.8 gamma for Mac monochrome monitors, and that has been abandoned for decades.
    The following remarks are exclusively for the benefit of OTHERS reading this thread in the future.  I have regretfully given up on zeno3333 entirely.
    zeno3333 wrote:
    The images I am using are not generated by an obsolete workflow....that is what i have been saying all along. The images i make are made in programs other than Photoshop...they are from Bryce like i have mentioned, and from POVRay.The programs make images the way that the programs make them....when i print out that image unaltered in any way, they are too dark on a Windows Printer.....
    Zeno3333 unfortunately fails to grasp that Bryce—and any other program he uses while running his improperly calibrated monitor— produce the dark images BECAUSE OF his workflow, which starts out on the wrong foot with a monitor calibrated to gamma 1.8.
    It's NOT the fault of the other programs, alas, it's Zeno3333's fault exclusively.
    zeno3333 wrote:
    …so please do not blame my "photoshop workflow"…
    There absolutely no one and nothing else to blame.  It is Zeno3333's workflow at fault, beginning with his improperly calibrated monitor.  Period.
    zeno3333 wrote:
    …Macs have different gammas than PCs....something that everyone here for some reason refused to get the reality of.
    WRONG AGAIN!  It is Zeno3333 who refuses to understand the basic concepts of color management.
    Computers, PCs or Macs, have no "gamma".  Color spaces do.  And color monitors are calibrated to a given gamma.
    The 1.8 gamma for Macs has been abandoned for a very, very long time.  What's more, some Windows users used to calibrate their monitors to gamma 1.8 in the distant past.  That is ancient history now, but it was by no means a Mac exclusive practice.
    Anyone interested in learning about COLOR MANAGEMENT can start here:
    http://www.gballard.net/psd/cmstheory.html

  • Mouse position capturing

    I was wondering if there is a way to capture the mouse position w/o the use of a frame or jframe? I already know how to use the MouseListener on the JFrame/Frame, but that is no help to me since I'm not using a frame at all. Any suggestions????

    What is your goal. This will work -- (the window is 1 pixel!) -- because the robot starts a "drag" and
    swing has mouse capture during drag, but as soon as the use clicks, it's over...
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class X {
        public static void main(String[] args) throws AWTException {
            JWindow w = new JWindow();
            Container cp = w.getContentPane();
            cp.addMouseMotionListener(new MouseMotionListener() {
                public void mouseDragged(MouseEvent e) {
                       System.out.println(e.getPoint());
                public void mouseMoved(MouseEvent e) {
            w.setBounds(new Rectangle(0,0,1,1));
            w.setVisible(true);
            Robot rob = new Robot();
            rob.mouseMove(0,0);
            rob.mousePress(InputEvent.BUTTON1_MASK);
            rob.mouseMove(100,100);
    [/code[

  • Getting mouse position into flash from JavaScript?

    Is there a way to get mouse coordinates in a browser that is
    cross browser compatible? I am able to track the mouse coordinates
    in all browsers except FireFox (Windows). In Windows firefox I can
    track the coordinates outside of the flash object but not inside
    the flash object. I am using the below script. Any help in this
    would be greatly appreciated. Thanks in advance.
    Regards,
    Beau

    I guess the easiest way is still to use a MouseMotionListener that you could add to your top level container. You could then store the value of the last position and still be able to access it even if the mouse hasn't moved.
    You might also want to use the following method : SwingUtilities.convertPointFromScreen(Point p, Component c);

  • Detect Mouse Position?

    I can't (within actionscript 3) determine where the mouse is
    relative to the flash player window.
    I can get stage.mouseX and stage.mouseY but those coordinates
    are in relation to the size of the entire ORIGINAL stage at compile
    time.
    I need to know where the mouse is in relation to the window
    playing the swf, which is significantly smaller than the original.
    That is the play screen has been resized.
    If I zoom way in and scroll to the right edge of the stage
    and mouseover a spot on the right edge, then trace the mouse
    position (in a mouseover event proc) it shows me a number that is
    the width of the ORIGINAL stage. It seems to be completely
    oblivious to the play window.
    Is there any way at all to determine where the mouse is
    relative to the play window?
    For example,
    if the original stage is 1350 and the play window is 540 and
    I'm zoomed WAY in and scrolled all the way to the right and
    I put the mouse directly in the middle of the window,
    I need something that tells me (in actionscript 3) that the
    mouse's x coordinate is at 270, NOT 12XX (somewhere near the end of
    the orginal size of the stage).
    Is this possible in Flash C3??

    Hi there!
    I don´t know if it´s right but have you tried
    localX
    localY
    from the occuring MouseEvent?
    Hope that helps :)
    CU
    Ingo

Maybe you are looking for