Including additional skin xml from Embedding vars

  • I have a few extra hotspot style skins and events that I want to include on a particular webpage and not on my main website.
    So I made another xml file to contain them.

    Code
    <krpano>   
    <style name="draghotspot" distorted="false" ondown=" spheretoscreen(ath, atv, hotspotcenterx, hotspotcentery); sub(drag_adjustx, mouse.stagex, hotspotcenterx); sub(drag_adjusty, mouse.stagey, hotspotcentery); asyncloop(pressed, sub(dx, mouse.stagex, drag_adjustx); sub(dy, mouse.stagey, drag_adjusty); screentosphere(dx, dy, ath, atv); );" onup="js( hotspotMoved(get(name), get(ath), get(atv)) );" onclick="oninterrupt(break); lookto(get(ath), get(atv)); screentosphere(mouse.x, mouse.y, mouseath, mouseatv); js( hotspotClicked(get(name), get(mouseath), get(mouseatv)) )" scale="0.5"/>
    <style name="polyhotspot" distorted="false" onclick="screentosphere(mouse.x, mouse.y, mouseath, mouseatv); js( hotspotClicked(get(name), get(mouseath), get(mouseatv)) )" fillcolor="0xFFFFFF" fillcolorhover="0xFFFFFF" fillalpha="0.1" fillalphahover="0.1" borderwidth="2.0" borderwidthhover="4.0" bordercolor="0xFFFFFF" bordercolorhover="0xFFFFFF" borderalpha="0.1" borderalphahover="0.8"/>
    <events onclick="screentosphere(mouse.x, mouse.y, mouseath, mouseatv); js( mapClick(get(mouseath), get(mouseatv)) );"/>
    <events onkeydown="showlog()"/>
    <events onloadcomplete="js ( sceneChanged() );"/>
    </krpano>

    How do I include them through Javascript along with the embed parameters?
    I tried

    Code
    var vars = {};
    vars["include[edit_skin].url"] = "/assets/pano/hotspot_editor_skin.xml";
    vars["include[edit_skin].keep"] = "true";
    embedpano({swf:swf_path,xml:xml_path,target:"pano",html5:"never",passQueryParameters:false,vars:vars,onready:krpanoReady});

    But that did not work. I am calling a js function krpanoReady, so I will have access to krpano variable to call external javascript functions from.

  • Hi,

    that's not possible - the <include> tag is a very special one that will be resolved during the xml loading. Later after the xml loading and parsing into the internal data/object structures there is no include anymore.

    Best regards,
    Klaus

Participate now!

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