next/previous buttons

  • Hello,

    I've been trying to create next and previous buttons that will load the previous or next scenes in a scenes document.

    The code that is almost working is :

    The problem I think is that each time the current scene number (cview) is being reset to zero, so I can do next and previous scenes but not the ones after. Any ideas on how I can dynamically define scene numbers so I can set a list?

    Cheers

  • Hi,

    here would be a fully automated solution (without any additional variables):

    just call either the 'prevscene' or 'nextscene' action,

    best regards,
    Klaus

  • Interesting!

    will this way also work with 'no scene' pano's? or is there an other code for that..

    so like if 19.xml... next is 20.xml *confused*
    *wacko*

    Thanx
    Tuur *thumbsup*

  • Hi,

    will this way also work with 'no scene' pano's? or is there an other code for that..

    no, not that code, the informations about the scenes are all loaded and there and it's possible to check for them,
    krpano can't know if there are other xml files out there,
    but it would be possible to predefine a variable for the current xml and one for the number of the xml files and
    then increase or decrease this variable and load the right xml file...


    Klaus how in the did you get so smart? Does code just come naturally? my next and previos buttons work but not like that. i had to create 12 different actions then set the onclicks to set what the next onclick would load.

    I have used a small trick for that:
    internally when loading a scene, it's content is stored in the "xml.content" variable (inside a <krpano> tag),
    then I loop through all scenes (known via "scene.count") and check if it is the current scene, and if yes,
    the previous or next scene will be loaded,

    another trick is - when the action is called without a parameter (%1), the counter variable (i) will be set to
    the start value, and in the other case when it was called with parameter (findnext), the varialbe 'i' will be
    not changed,
    this allows small loopings,

    best regards,
    Klaus

  • Hi,

    Possible to disable the Preview Button when you are in scene1, and the Next Button when you are in the last scene , eg scene6 ?

    that's a bit more complex,
    but here is an example code:


    best regards,
    Klaus

  • I have used a small trick for that:
    internally when loading a scene, it's content is stored in the "xml.content" variable (inside a <krpano> tag),
    then I loop through all scenes (known via "scene.count") and check if it is the current scene, and if yes,
    the previous or next scene will be loaded,

    Hi Klaus. I know this is a great solution but since I am thick could you please check why mine is not working

    Thank you

  • Hi Klaus,
    Any chance that you could better (improve) this code by allowing the scene to transition, or tween, into the next scene without stopping when autorotate is enabled? That would make it perfect for timelapse shots.
    Thanks for the consideration.
    Tony

  • Hi,

    Any chance that you could better (improve) this code by allowing the scene to transition, or tween, into the next scene without stopping when autorotate is enabled? That would make it perfect for timelapse shots.

    I'm already planing that, but this needs a bigger change in the core viewer engine, so it can still take some time,

    best regards,
    Klaus

  • Hi,

    i try to make next picture button..

    here some code.. but get stuck in the next_pic action (the buttons under the big picture :

    *cry* *wacko*

    full xml: http://www.virtualtuur.com/krpano/simple/9/gallery9.xml (but i'm editing some here.. so it changes..)

    example: http://www.virtualtuur.com/krpano/simple/9/


    Tuur *thumbsup*

  • Hi,

    i try to make next picture button..

    here some code.. but get stuck in the next_pic action (the buttons under the big picture :

    *cry* *wacko*

    full xml: http://www.virtualtuur.com/krpano/simple/9/gallery9.xml (but i'm editing some here.. so it changes..)

    example: http://www.virtualtuur.com/krpano/simple/9/


    i thought and am trying also something with copy and inc i ... *unsure*


    Tuur *thumbsup*

Participate now!

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