A Tutorial on Krpano Action Arguments (pt 1)

  • jordi - first thing i wanted to say was great photography and i love the transition from pano to pano. that is something krpano is way behind on from FPP. Also your top bar inside the pano does not strech all the way to the edge on my 22" monitor. auditorium and shop are floating in the air.

    i tend to use separate xmls for almost everything. it reduces load times. even though the hotspots and plugins inside the individual scene tags are not setup until that scene is loaded it all still has to be parsed from the start before anything happens.

  • hi.
    I'm using demo version still, but...
    I define some action

    Code
    <action name="testa">
    showtext(%1);
    </action>

    Then trying to call it:

    Code
    <hotspot name="somespot" url="img/dymek.png" ath="-10.94" atv="3.62" scale="1" zoom="false" onclick="testa(supertest);" onhover="" />


    and it's not working but:

    Code
    <hotspot name="somespot" url="img/dymek.png" ath="-10.94"  atv="3.62" scale="1" zoom="false" onclick="action(testa,supertest);" onhover=""  />


    works just fine.

    What did i wrong?

  • Hi Kamilus,

    Nothing wrong... the two ways to call an action are correct since krpano 1.0.8 beta 8


    user defined actions <action> can now be called "direct"
    e.g. instead of:

    Code
    action(actionname, parameters...);


    now also just:

    Code
    actionname(parameters...);

    is possible

    Perhaps, it should be better to use onhover instead of onclick to call the showtext()

    Code
    <hotspot name="somespot" url="img/dymek.png" ath="-10.94" atv="3.62" scale="1" zoom="false" onclick="" onhover="testa(supertest);" />

    SAlut.

  • Hi everyone, I have this 1 problem:
    I pass data from database to file index.html


    var lobby = {!! json_encode($lobby) !!}
    var virtual = {!! json_encode($virtual) !!}
    console.log(lobby.videos[0]);
    embedpano({
    swf: "/" + lobby.sample.file + "/tour.swf",
    xml: "/" + lobby.sample.file + "/tour.xml",
    target: "pano",
    html5: "auto",
    initvars: {
    virtual: virtual.title,
    mypath: "assets/images/standee/1.png",
    setting: virtual.setting_expo,
    videolink: window.location + "/video",
    videolobby: lobby.videos[0],
    lobby: lobby


    },
    mobilescale: 1.0,
    passQueryParameters: true
    });


    in tour.xml file, i have 1 video hotspot passed videolobby value


    <hotspot name="hs_video_5"
    url="/%$setting.standee%"
    pausedonstart="false"
    loop="true"
    distorted="true" ath="-0.221" atv="-14.443" rx="-13.1" ry="2.0" rz="0.0" scale="0.203" alpha="1.0"
    onload="hs_video[hs_video].play();"
    onclick="looktohotspot(get(name),90); youtubeplayer_open(videolobby.video_link);
    sound_off(hs_video);"
    onhover="action(showHotSpot_text, Watch video) "
    />
    in the function youtubeplayer_open
    I trace(%1) the correct data
    but when i insert in 1 iframe it takes the variable name and not the value i pass in:


    txtadd(iframecode, '[iframe width="',get(layer[youtubeplayer_plugin].width),'" height="',get(layer[youtubeplayer_plugin].height),'" src="https://www.youtube.com/embed/',%1,'?',get(youtubeplayer_settings.parameters),'" frameborder="0" allowfullscreen][/iframe]');


    Show me how to transmit data

Participate now!

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