<krpano> tag, onstart and delayedcall

  • Hello,

    I use the following code to hide instrucions automatically after 10 seconds. It works and I am very happy with it.

    Code
    <krpano version="1.0.8" onstart="delayedcall(10, action(hideinstructions); );">

    At the momment I have the panoramas in itscorresponging folder (room1, room2, room3, etc...)

    Inside each folder I have the panorama image and a pano.xml file which contains all the parameters that may be different depending on the panorama ( hlookat, vlookat, tileimagewidth, etc...)


    As you can see I include global.xml and plugins.xml. Both files contain all the parameters common in all the panoramas (display, autoritate, progress, plugins, etc..)
    This way if I would like to change the display details parameters I just have to edit globals.xml once and it will affect all the panormas.

    Now, the question: is there another way to call the action 'hideinstructions' apart from inside the <krpano> tag? If in the future I wouldn't like to edit all the pano.xml files if I would like to change the delayedcall from 10 to 20.

    Thanks in advance.

  • you might be able to change this...

    Code
    <krpano version="1.0.8" onstart="delayedcall(10, action(hideinstructions); );">

    to...

    Code
    <krpano version="1.0.8" onstart="action(hideinstructions); );">

    and then in your "hideinstructions" action use the wait function... reference link below.

    http://www.krpano.com/docu/actions/#wait

    Then, when you want to change the wait... it's only changed once in the "hideinstructions" action.

    You'll want to be sure to use the oninterrupt item as well...

    http://www.krpano.com/docu/actions/#oninterrupt

    ... otherwise users will be stuck waiting until your hideinstructions sequence is complete, including however long you set the wait for.

    Graydon

  • At first I thought maybe the

    Code
    );

    weren't matching up... but it looks like they are.

    Then I thought... there's something screwy with IE and having to leave off the ; on the last variable... but I think that's a swfobject 2.1 issue only...

    ... so that only leaves me the following suggestion (which the other post seems to indicate doesn't matter)
    - change

    Code
    krpano.onstart

    to just

    Code
    onstart

    Other than that... *confused*

  • Now, the question: is there another way to call the action 'hideinstructions' apart from inside the <krpano> tag? If in the future I wouldn't like to edit all the pano.xml files if I would like to change the delayedcall from 10 to 20.

    Hi,

    in the 1.0.8 beta 7 there are also some new events that could help here:

    "onxmlcomplete" - will be called when a XML or a SCENE was loaded
    "onloadcomplete" - will be called when the loading of the pano images was done

    e.g.

    Code
    <events onxmlcomplete="..."
            onloadcomplete="..."
            />

    these events will be called in every new loaded XML until
    the events itself will be redefined,

    best regards,
    Klaus

Jetzt mitmachen!

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