Bug or feature. loop and oninterrupt

  • I want to interrupt the loop event click mouse.
    interrupt running in HTML5, but does not work in FLASH.
    krpano 1.17.5

    Code
    loop(hovering,
      oninterrupt(break); 
      wait(0);
      set(layer[test].visible, true);
    );
  • Hi,

    what are you trying to do?

    That current code can't work - the loop() action is 'synchronous' - that means the code will loop as long as the given condition is set, but during that loop nothing from 'outside' can happen, so the hovering value can never change. The additional oninterrupt+wait and are looking a bit strange...

    There exists probably a better and more correct solution for your case ;-).

    Best regards,
    Klaus

  • Hi Klaus! )
    This realization of tooltips.
    While the cursor is over the layer - layer[hint].visible, true
    At this time, "loop" is blocking the code - layer[hint].visible, false
    Once the cursor fled (hovering=false), running - layer[hint].visible, false
    But I want to be able to interrupt the "loop" by clicking.
    All code runs through "onover".

    Code
    loop(hovering,
      oninterrupt(break); 
      wait(0);
      set(layer[hint].visible, true);
    );
    		
    set(layer[hint].visible, false);
  • Hi,

    why not using the included tooltips example as reference?

    And why setting visible constantly to true during the loop?
    Normally once would be enough...

    How is 'interrupting by click' during the hovering meant?

    Maybe have a look at the asyncloop action:
    https://krpano.com/docu/actions/#asyncloop

    There you could do something like that:

    Code
    onover="#1; asyncloop(hovering, #2, #3);"


    where:
    #1 = the code that should be called when the hovering starts
    #2 = the code that should be called during the hovering every frame
    #3 = the code that should be called when the hovering ends

    Best regards,
    Klaus

  • Klaus, thank you very much for your help! *smile*
    "asyncloop" *doneactions - This is what I need.
    I have a not trivial task, so needs its own implementation "tooltips"
    By the way "doneactions" emerged recently seems, had not seen this feature.

Participate now!

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