oninterrput not working

  • Hallo, i've created here an self rotating and changing tour. the problem is that if i try to use user interaction to stop the actions , it doesn't interrupt the actions


    http://www.360concept.ro

  • This is a stripped part of the code.as u can see it has only on action with one tween. all i need is to stop that tween on user click ,or movement.i've tested breakall, stopall or stop.Nothing works

  • Hi booghy08,

    A tween could not be stopped in using break... You should use stopall() , breakall() or stoptween(var)... See here...
    Also, it seems that the call of your action onstarttur() from onstart makes the oninterrupt() action to not works properly... Do not know why....
    edited: after more tries it seems that the above was something on the code I used to test, that causes a problem...
    Try to delayedcall() your action:


    Doing in this way it works...
    Or call your action from an event like onxmlcomplete or onloadcomplete...

    SAlut.

    Edited once, last by michel (September 25, 2010 at 7:09 PM).

  • Hi michael,
    i've tried your ideas but neighter or them worked , the tween doesn't stop.I've tried a hack by comparing the movement of the mouse with the events onmousedown and onmouseup.
    if someone knows how to make oninterrupt work on the krpano version 1.0.8.11, i'll wait for your reply.

  • Hi booghy08,

    I think all the problem come from how oninterrupt() works:

    oninterrupt(newaction)
    - this function can be set before starting a lot of action calls
    - it was called when a mouse click interrupts one of following actions
    - after interrupting or processing all actions, this function will be disabled until next call
    ....

    On your example,the last action is the tween itself... So, the oninterrupt() action becomes disabled ....
    Then, for this example, a possible working code could be adding a WAIT argument to the tween... Like this:

    Hope this help...

    SAlut.

  • Hi,

    right, oninterrupt works only with functions/actions that are blocking the user interface,
    that are only the lookto/moveto/zoomto/wait and the tween(..., WAIT) actions,

    and when it was called, then all actions that were left it the actions queue (thats are all actions that are after the current executing action) were removed, and also the oninterrupt itself is also cleared,

    normal tweens (without WAIT) are something different, they are running independtly of the normal actions,
    they will not be touched in anyway by the oninterrupt() usage,

    normal tweens can only be stopped by the stoptween() action,

    so, the solution from michel is already a right one

    alternatively you could use the lookto() action, this is also a 'blocking' action (like the tween with WAIT),
    both can be interrupted,
    e.g.

    Code
    <action name="onstarttur">
      oninterrupt(break);
      lookto(360,get(view.vlookat),get(view.fov), smooth(2,2,24), false);
    </action>

    best regards,
    Klaus

  • my solution for the problem. but there is just a small bug that i can't solve. if i stop the pano twice from moving in a short interval, it call twice the delayedcall(2,if(delayedcallkilled == true,loadpanos(noload))); , and i only want to do it once.

    the way the code works:
    spiner= if u have hlookat set at -20 it will spin until -340 or -380 (from left or right);
    check_view= sets the spiner
    init_view = it stores the initial view point , so when u stop the pano it doesnt calculate from the last view point
    var_current_pano= the pano id ;
    noload(from the loadpanos action)= this one i'll let u figure it out :P

  • Hi


    i would like to program the equivalent of a "pausetween"

    i tested the autotour with oninterrupt(break) and the WAIT donecall, the stoptween without the WAIT donecall, precisely i would like to be abble to interrupt a tween(hlookat or vlookat and after on oniddle the tween finish the mouvement.

    does somebody ever wrotte this code ?

    maybe the solution could be in an autotour to incstep -1 on iddle but there is a conflict with the oniddle(setuptour) from the autotour.


    thank you

  • Thank you, the probleme is that i havent only one step in my autotour, so… i havent any simple solution that why i was looking for a"pausetween" or oninterrupt(pause) fonction.
    Maybe there somethink i missed.

  • ok how ?


    for exemple


  • maybe like this

Participate now!

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