events onloadcomplete in scene problems...

  • hye there.. anyone can solve this problems that i have...

    let say... i hv three scene... so id loadscene 1, .. in scene one i hv this event onloadcomplete.

    then id click to this button to go to 2nd scene/3rd scene,...

    this is the code for other button, ... onclick="loadscene(scene2, null, KEEPALL, BLEND(2)); " how to kill/delete or disable the first onloadcomplete at the 1st scene?

    thanks

  • Hi Bulp,

    To change an attribute into a xml node look here: Scripting / Programming documentation.

    you can do set(scene[scene1].onloadcomplete,some_new_action_to_do);

    Try doing this:

    Code
    onclick="loadscene(scene2, null, KEEPALL, BLEND(2));set(scene[scene1].onloadcomplete,null); "

    I have not tryed de null value but i think it will work.

    Hope this can help.

    Salut.

  • Hi,

    Quote

    let say... i hv three scene... so id loadscene 1, .. in scene one i hv this event onloadcomplete.

    then id click to this button to go to 2nd scene/3rd scene,...

    this is the code for other button, ... onclick="loadscene(scene2, null, KEEPALL, BLEND(2)); " how to kill/delete or disable the first onloadcomplete at the 1st scene?

    you could clear the onloadcomplete event after the loadscene call, e.g:

    Code
    onclick="loadscene(scene2, null, KEEPALL, BLEND(2)); set(events.onloadcomplete,null);

    or just a custom variable as flag, and check for it,

    you can do set(scene[scene1].onloadcomplete,some_new_action_to_do);

    this will not work at the moment, have a look here:
    https://krpano.com/forum/wbb/inde…ad&threadID=948

    best regards,
    Klaus

  • thanks Michel.. thanks Klaus.. will try it later...

    but then how to kill delayed command? in event onloadcomplete delayed something...

    actually id just edited the Klaus sample date 15 jun 2009 in little planet view... and add new scene there... so thats my probs to kill the event onloadcomplete delayed..

    im still learning more bout scriptping... certain thing so clear but maybe im just novice.. haha

    cheers..

  • Hi,

    there is currently no way to kill a delayedcall
    but a "flag" variable could be used,
    e.g.

    Code
    set(delayedcallkilled,false); delayedcall( if(delayedcallkilled == false, action(dosomething)); );

    to "kill" (avoid executing) the event set "delayedcallkilled" to "true"

    best regards,
    Klaus

  • id already settle this probs... by not using that script.. since its not worling.. dunno why.. maybe me or my laptop.. hehe

    anyway ... this is my sample scripts...

    Code
    <krpano version="1.0.8" onstart="action(start);" >
    
    
    <!-- start - load first scene --><action name="start">loadscene(scene1, null, MERGE);   delayedcall(20.0, normalview());    </action>


    so this delayedcall only run for one time only... unless we put the delayedcall command inside <scene> structure....

    cheers..

Participate now!

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