Removing "Mouse Down" State when a user hovers outside the viewing window

  • Hi everyone, I'll do my best to explain this clearly, but feel free to ask me to clarify if needs be.

    The issue I'm having is that whenever the user clicks and drags the mouse cursor outside of the 360 window, the 360 thinks that the cursor is still there, and continues to spin rapidly towards it. I know that this is a fairly standard Flash behaviour, but is there any way to avoid it?

    Ideally, it would make sense (To me, at least) to have a javascript "OnMouseOver" event on the container div outside the tour and have it send some kind of message to KRPano when the user strays beyond the confines of the 360 window, allowing KRPano to understand that the mouse is no longer hovering over it.

    Is this a possibility?

    Many thanks,
    Adolfo

  • Hi,

    yes, this is a Flash specific problem - BUT - the swfkrpano.js script should automatically fix that issue!

    e.g. test it here:
    https://krpano.com/docu/swfkrpano…sewheelfix.html

    best regards,
    Klaus


    Thanks Klaus - looks like I was accidentally running the new swfkrpano.js file with an older version of krpano.swf. Thanks for putting me on the right track!

    This fixes the issue where the tour continues to move towards the mouse when the user hovers outside the window, which leads me to a second question:

    I have a semi-transparent div positioned on top of the tour that functions as a menu to select the different panoramas. Dragging the mouse over this causes the same issue highlighted above - is there a way around this?

  • Hi,

    I have a semi-transparent div positioned on top of the tour that functions as a menu to select the different panoramas. Dragging the mouse over this causes the same issue highlighted above - is there a way around this?

    Okay, this is a special case - the swfkrpano.js script itself only tests for mouse-releases outside the pano window, mouse-release inside the pano window are assumed to be caught by the Flashplayer.

    A way to fix that, would be to get the mouse-up event on your element and send to it krpano.

    e.g. here a Javascript code for doing that:

    Code
    var overlappingdiv = document.getElementById("ID-OF-YOUR-SEMI-TRANSPARENT-DIV");
    overlappingdiv.addEventListener("mouseup", function()
    {
      var krpano =  document.getElementById("krpanoSWFObject");
      if (krpano && krpano.externalMouseEvent2)
      {
        try{ krpano.externalMouseEvent2(0, "mouseUp"); } catch {}
      }
    }, false);

    Best regards,
    Klaus

  • Hi,

    Okay, this is a special case - the swfkrpano.js script itself only tests for mouse-releases outside the pano window, mouse-release inside the pano window are assumed to be caught by the Flashplayer.

    A way to fix that, would be to get the mouse-up event on your element and send to it krpano.

    e.g. here a Javascript code for doing that:

    Code
    var overlappingdiv = document.getElementById("ID-OF-YOUR-SEMI-TRANSPARENT-DIV");
    overlappingdiv.addEventListener("mouseup", function()
    {
      var krpano =  document.getElementById("krpanoSWFObject");
      if (krpano && krpano.externalMouseEvent2)
      {
        try{ krpano.externalMouseEvent2(0, "mouseUp"); } catch {}
      }
    }, false);

    Best regards,
    Klaus

    Hi Klaus,

    This works perfectly! Thanks for saving me hours of trying to work this out on my own.

    I really appreciate the high level of support you put into KRPano.

    Thanks,
    Adolfo

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!