use variable in loadpano xml path

  • krpano 1.16.5

    to keep the flash version from caching the xml (all my xmls are dynamic) i generate a randomnumber in javascript and set it to a krpano variable
    >


    function pano_set_randomnumber(){
    var ran = Math.floor(Math.random()*11124567489789*Math.random());
    krpano.call("set(randomnumber,"+ ran + ')');
    }

    my hotspots call
    js( pano_set_randomnumber() );loadpano(/rooms/room1.xml?bla=%$randomnumber%, null , MERGE, BLEND(1));

    same for loadpano('/rooms/eingang.xml?bla=%randomnumber%', null , MERGE, BLEND(1));


    but the variable isn't set

    chrome network log>GET http://localhost:3000/rooms/gate.xml?bla=%$randomnumber% 400 (Bad Request)

    same for GET http://localhost:3000/rooms/gate.xml?bla=%randomnumber% 400 (Bad Request)


    how can i set variables in the xml attribute of the loadpano function? *confused*

    problem solved



    function pano_set_randomnumber(){
    var ran = Math.floor(Math.random()*11124567489789*Math.random());
    krpano.set("randomnumber", ran);
    }


    js( pano_set_randomnumber() );showlog();trace(get(randomnumber));set(view.maxpixelzoom,null);set(view.fovmin,20);looktohotspot(get(name),60,smooth(400,20,100));
    loadpano('/rooms/room1.xml?bla=%$randomnumber%', null , MERGE, BLEND(1));

    Edited 5 times, last by grabher (August 14, 2013 at 1:38 PM).

Participate now!

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