Cancel a delayed call ?

  • Hi,

    I have, for introduction of my Vtour, two different text pictures plugins :

    Code
    <krpano version="1.0.8"  
    		onstart="startup();
    			     tween(plugin[presentation].alpha, 1.0, 2.0);  <!--background-->
    				 tween(plugin[txt_presentation_un].alpha, 1.0, 2.0);
    				 delayedcall(15.0, tween(plugin[txt_presentation_un].alpha,0.0,0.5));
    				 delayedcall(15.0, tween(plugin[txt_presentation_deux].alpha,1.0,0.5));
    				 delayedcall(22.0, hide_presentation());">


    Both plugins got an onclick setting for those whose come several times on the site and want to pass the intro :


    My problem is when you click during the first presentation, the field disappear but the second one still running on his time.!

    Any suggestion ?

    Thanks. *smile*
    Steph.

  • Hi,

    I've tried many ways and it doesn't work. *cursing*

    I separate the delayed calls variables in "actions" called from the onstart="delayedcall(1.0, A1()); delayedcall(9.0,A2()); " , put the variables to change in the actions. Then tried to stop A2(); with a stopall variable in my first plugin it doesn't work. I use the delayedcallkilled/stop, it doesn't work. Anyway if i've got differents delayedcalls running, i want to turn off one only. I can't use the "events" neither for the same reason.

    I even tried from the plugins with a onclick="set(plugin[2].delayedcallkilled,true)" variable. Then a "delayedcallkilled=false" variable in the second one. It still running on his time.

    In the thread you quoted, Klaus asked to "Corsifo" where did he change the delayedcallstop variable. I put mine in many places, before, after, in the "action" or in the "onstart" setting, plugin, still the same.


    The thread you quoted is from 2009. Today is it possible to cancel a named delayedcall or even erase an action before it's starting when clicking on the first plugin ?

    This give me a headache.!
    Thanks. *smile*
    Steph

  • Stopping the action is no problem, use variables and an if statement.

    for instance
    <action name="scaleimage">


    if(plugin[closebutton].visible == true,
    delayedcall(0.5,scaleimage(photo,changed));
    );

    running continuously, if the close button is visible.
    if I click on the close button and via another action make visible false, it stops running.

    Use the trace function to help yourself.

  • Thanks sachagriffin, but it can't work for my problem because i use the visible and alpha settings for transition between my two plugins.

    I solved it by adding a scale set to 0.0 for the second plugin in the action "onclick" of the first one. So the second one stil running but it's not visible.
    That's what i found pending something more professional! *wink*

    By the way, what's the trace function (thought it was in AS3) ?

    Thanks everybody. *smile*
    Steph

    Steph

    Einmal editiert, zuletzt von esys (1. April 2011 um 00:39)

  • Use any variable set you wish..


    as for trace...
    WHAT!?
    How are you able to get anything done without it without taking hours of watching nothing happen and wondering why not... ??

    Up top ^^^^ there's a documentation section. In this section are the actions sections, in that are functions you can use.

    https://krpano.com/docu/actions/

    https://krpano.com/docu/actions/You can output anything to the log screen.

    Thanks sachagriffin, but it can't work for my problem because i use the visible and alpha settings for transition between my two plugins.

    I solved it by adding a scale set to 0.0 for the second plugin in the action "onclick" of the first one. So the second one stil running but it's not visible.
    That's what i found pending something more professional! *wink*

    By the way, what's the trace function (thought it was in AS3) ?

    Thanks everybody. *smile*
    Steph


  • as for trace...
    WHAT!?
    How are you able to get anything done without it without taking hours of watching nothing happen and wondering why not... ??

    It could surprise people the poor knowledge i've got, but it's got a name when you begin to learn encoding on your own at 33 years by desire to progress in computer: Patience.

    As for your enlightening, thanks, one more step. I understood it but need to pratice a little to get help from it, from now on. I've some problem with the syntax of "trace" . For example, in this case what could've been the syntax to show the errrors.
    You seem to be good apart from Krpano (6 posts here only). It's a pleasure to progress thanks to people like you. *wink*


    Steph.

  • Yeah, I just forced myself to start programming a few years ago. Having to program across languages ( javascript, php, krpano), means I'm constantly struggling with syntax and program like an old lady using a walker.
    I just came over from FPP, and its amazing how less convoluted I can do the same stuff in KRPANO and not even need any plugins.

    BTW, does anyone have a clue what are the mod and pow math functions?

    with trace, you trace out all your variables before you change them and after you change them, this ensures you're calling your functions properly. Otherwise, you're just flinging around data and hoping it sticks against the wall.

    trace('variable 1 is: ', get(var1));

    the tracings showing after you press "o"

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!