Problems with palceholders and actions

  • Hello,
    I've got the following problem.
    I wan't to create an action, which is allways called if I click on different hotspots.
    In this action there should be a picture shown, which belongs to the hotspot (picture one, to hotspot one, picture two to hotspot two .... like the followqing code snippets!

    I did it like that example I attached, but allways the last window I defined in the "open_window"-action was called.
    Something must be wrong, but I can't find the solution! *confused*

    Can someone help me? *question*

    Thanks a lot
    Olli

    ...
    <hotspot name="one"
    ...
    onclick="action (open_window);"
    ...
    </hotspot>

    <hotspot name="two"
    ...
    onclick="action (open_window);"
    ...
    </hotspot>

    .......

    <plugin name="window_one" url="....." /> which belongs to hotspot one

    <plugin name="window_two" url="..." /> which belongs to hotspot two .... and so one.

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


    <action name="open_window">
    open (window_one);
    </action>

    <action name="open_window">
    open (window_two);
    </action>

    ......

    </krpano>

  • use a hotspot for each photo. using the action below you can tell the plugin which photo to display

    <hotspot name="one"
    onclick="open_window(photos/test1.jpg)
    </hotspot>

    <hotspot name="two"
    onclick="open_window(photos/test2.jpg)
    </hotspot>

    however you only need 1 plugin for ALL of the photos. set it invisible and alpha 0 to the center of the screen.

    <plugin name="window_one" url="" visible="false" alpha="0" align="center" onclick="close_window()" onhover="showtext(Click to Close);/>

    using only 1 action you can populate the plugin url. make it visible then fade in over 1 second.

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

    use a second action on the photo itself to close it. the delayedcall allows the plugin to fully fade away before hiding it.

    <action name="close_window">
    tween(plugin[window_one].alpha,0,1);
    delayedcall(1, set(plugin[window_one].visible, false));
    </action>

  • Hello "VN2009"

    Thank you for your quick answer.
    Now I read this the second time and I realize that's exact the solution I looked for! *thumbsup*

    Thank's a lot
    Olli

    Edited 2 times, last by Oliver (January 14, 2011 at 8:02 PM).

Participate now!

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