Embedding in iframe breaks click & drag ...

  • https://dl.dropboxusercontent.com/u/80050021/ScrollTestFixed.capx

    Steps to reproduce:

    1. Run the app.

    2. Click and then drag up and down to scroll the red rectangles.

    3. Try to go out-of -bounds in iframe by still holding, which seem to occurs naturally for anyone playing and leave the button unpressed.

    4. Then you go back inbounds and it still thinks the button is pressed and you were still able to scroll back and forth without even clicking and then it hangs after.

    Observed result:

    It hangs and it allows you to scroll even if you are not clicked.

    Expected result:

    once the button is released it should go back normal so that even i go out-of-bounds it should still works when i come back in-bounds.

    Browsers affected:

    Chrome: yes

    Firefox: yes

    Internet Explorer: yes

    Operating system & service pack:

    Windows 7

    Construct 2 version:



    More Information [/b> I embedded my app in an iframe, https://dl.dropboxusercontent.com/u/80050021/ScollTest/iframe.html, my app has a drag to scroll controller which i can hold and drag to scroll up and down. Everything works fine as it is , But when i am embedding in an iframe and in case if my drag goes beyond inframe bounds then everything kind of get struck and breaks even i get my cursor inbound to the iframe. Even after i release the cursor it still thinks that i am still pressing it . Trying to figure out how to resolve, any help ? This is link https://dl.dropboxusercontent.com/u/80050021/ScollTest/ where everything works fine without the iframe. Here is the capx, https://dl.dropboxusercontent.com/u/80050021/ScrollTestFixed.capx

  • Can anyone help i already have my game in Kongregate.com and gamers are complaining already because of the iframe embed issue. please help !

  • did you try to clamp dragging?

    for example

    mouse cursor Y<5 and Y>595 stop dragging (595 is your window height-5)

    that way this will force stop stop dragging in that 5 pixels border even if player will still keep mouse button pressed

  • Can you reproduce in r139? Why are you still on an old beta release? It has lots of known bugs we've already fixed. Usually we don't accept bug reports that are not tested in the latest version.

    I think we can't fix this, because it's not a Construct 2 bug, it's a browser issue. For security reasons browsers don't let the iframe know about mouse events that happen over a different frame, so dragging out the frame will mean the mouse up is not sent to the iframe, so it still thinks the mouse is down. Perhaps there is some CSS/JS workaround, I'm not sure...

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Oh, which means my type of game can't be embedded in iframe where drag and scroll is needed ? I am sure there might be some way to fix. please help !

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)