Sie sind nicht angemeldet.

1

Dienstag, 11. Januar 2011, 18:13

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>

Zephyr

Profi

Beiträge: 1 003

Wohnort: Netherlands

Beruf: Web developer

  • Nachricht senden

2

Dienstag, 11. Januar 2011, 18:26

the actions need different names , else the last one overwrites the other. So you need a open_window_2, open_window_1 etc action

3

Dienstag, 11. Januar 2011, 18:26

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>

4

Dienstag, 11. Januar 2011, 19:42

Problem with placeholders and actions

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

Dieser Beitrag wurde bereits 2 mal editiert, zuletzt von »Oliver« (14. Januar 2011, 20:02)


Ähnliche Themen