changing image galleries in a tour

  • I am a new user and pretty new to XML, so please bear with me. I am creating a tour based on the "tour" example provided with krpano. I also want to add the image gallery plugin, but would like to have different images display with each "location". The problem I am having is that in the master XML file, called "tour", the loadpano command seems to require that I use either KEEPALL, KEEPBASE, or KEEPPLUGINS in order for it to load the first pano. Like this:
    <action name="load1">
    loadpano(1.xml,null,KEEPALL,BLEND(2));
    </action>
    If I use any other flag, such as MERGE, it gives me errors and wont load. So I can put my image gallery code on the XML of the second location, and use MERGE in the load2 action, which works fine. But when I leave location 2 and come back to 1, the image gallery from 2 is still present.

    I figured I could work around this by duplicating the first location and then setting the hotspots to bounce between locs 2 and 3, but this seems needlessly cumbersome.

    Any ideas what I need to do differently?

  • Hi,

    what "image gallery plugin" do you mean - maybe the simplerviewer?

    because:

    Quote

    the simpleviewer can be only used once inside krpano,
    this is unfortunately a limitation of the simpleviewer itself,
    there is currently no way to change that,


    what errors do you get when using MERGE?

    best regards,
    Klaus

  • What I am using is the code from the "image gallery" example provided with krPano. Maybe this is not actually a plugin, in that it is not referring to an external file.

    Here is my entire code for the "master" XML file:
    <krpano version="1.0.6" onstart="action(load1);">
    <include url="plugins.xml" />


    <display details="32" movequality="LOW" stillquality="HIGH" />

    <view hlookat="0"
    vlookat="0"
    fov="85" fovmin="50" fovmax="110"
    fisheye="0.40" fisheyefovlink=".5" limitfov="true"
    />

    <!-- change the default textstyle for showtext: -->
    <textstyle name="DEFAULT"
    font="Arial" fontsize="14"
    border="false" background="false"
    textcolor="0xFFFFFF"
    effect="glow(0x000000,0.7,4,2);dropshadow(4,45,0x000000,4,1);"
    />

    <textstyle name="smalltext"
    font="Arial" fontsize="10"
    border="false" background="false"
    textcolor="0xFFFFFF"
    effect="glow(0x000000,0.7,4,2);dropshadow(2,45,0x000000,3,1);"
    />


    <!-- actions -->

    <action name="startloading">
    set(hotspot.visible,false);
    push(view.fovmin);
    set(view.fovmin,1);
    </action>

    <action name="loadingdone">
    pop(view.fovmin);
    set(hotspot.visible,true);
    </action>

    <action name="lookinterrupt">
    action(loadingdone);
    breakall();
    </action>


    <action name="load1">
    loadpano(1.xml,null,KEEPALL,BLEND(2));
    </action>

    <action name="load2">
    loadpano(2.xml,null,KEEPBASE,BLEND(2));
    </action>

    <action name="load3">
    loadpano(goleft.xml,null,KEEPBASE,BLEND(2));
    </action>

    <action name="fadein">
    set(plugin[%1].visible,true);
    tween(plugin[%1].alpha,1,0.5);
    </action>

    <action name="fadeout">
    tween(plugin[%1].alpha,0,0.5,easeoutquad,set(plugin[%1].visible,false));
    </action>

    <plugin name="btn1" url="images/button1.png" align="bottomcenter" y="15" x="-75" width="50" height="50" onover="action(fadein,img1);" onout="action(fadeout,img1);" />
    <plugin name="btn2" url="images/button2.png" align="bottomcenter" y="15" x="-25" width="50" height="50" onover="action(fadein,img2);" onout="action(fadeout,img2);" />
    <plugin name="btn3" url="images/button3.png" align="bottomcenter" y="15" x="+25" width="50" height="50" onover="action(fadein,img3);" onout="action(fadeout,img3);" />
    <plugin name="btn4" url="images/button4.png" align="bottomcenter" y="15" x="+75" width="50" height="50" onover="action(fadein,img4);" onout="action(fadeout,img4);" />

    <plugin name="img1" url="images/image1.jpg" align="center" alpha="0" visible="false" />
    <plugin name="img2" url="images/image2.jpg" align="center" alpha="0" visible="false" />
    <plugin name="img3" url="images/image3.jpg" align="center" alpha="0" visible="false" />
    <plugin name="img4" url="images/image4.jpg" align="center" alpha="0" visible="false" />

    </krpano>

    The error I get when use MERGE in "load1" caome up in a box that says "An Actionscript error has occurred" and then:
    ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.
    at flash.display::DisplayObjectContainer/removeChild()
    at krpano::krpano_plugin/destroy()
    at krpano::krpano_base/removeplugin()
    at kflashpano::Kpano/remove_not_keeped_objects()
    at kflashpano::Kpano/loadpano()
    at kflashpano::Kactionqueue/call_action_loadpano()
    at kflashpano::Kactionqueue/process_actions()
    at kflashpano::Kactionqueue/parse_action()
    at kflashpano::Kactionqueue/callaction()
    at kflashpano::Kpano/startviewing()
    at kflashpano::Kpano/xmlloaddone()
    at kflashpano::Kxml/loading_xml_finished()
    at kflashpano::Kxml/load_xml_includes()
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at flash.net::URLLoader/onComplete()

    Over the weekend, I was wondering if it would just work better to create three separate tours with "loadpano" actions on the hotspots. It looks like I could use MERGE with that action as well.

    Thanks for your help!

Participate now!

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