Alex, I am interested in a different alignment, too. I would like to open the window on the bottom of the page (some pixels above the bottom would be even better).
Thank you!
Posts by Remi
-
-
Ok, I think I get it. You are really resourceful, thank you!
But sometimes I would still like to use the txtadd method.For example, when klicking on the nm1 hotspot, I would like to play a sound from http://randomadrress.com/folder/kitchen.mp3,
which would probably need me to do some kind of txtadd(var, 'http://randomadrress.com/folder/', get(description.get(nm1)), 'mp3'). Of course there are workarounds, but I can't find a straightforward way to do it (to make a code that could easily be understood and modified afterwards, if needed).p.s.: even with the txtadd it seems to be working now. The trick is, again, to send the name as %1 as the argument of the variable in the first place. Thanks! If you ever come to the slovenian sea-side, I owe you a beer.
-
Thanks for your reply, Piotr!
I'm sorry, I already used the name without brackets. I just wrote them here by mistake.
The second idea works, thank you!
Still, why do showtext() and trace() work so differently? Why does one show kitchen and the other remains at description.nm1?
and why wouldn't
<hotspot name="nm1", onhover="showtext(get(description.get(name)))" ...> work?
Why does a variable have to be passed to a function just to replace the %1 with get(name) afterwards instead of working directly? Is it because krpano can't automatically find the value of the variable in the internal bracket before going on to the external ones?I read the tutorial about how variables work in functions, but I can't find a answer there.
-
Hello!
I'm sorry to bother you with what I suppose is something everyone should know… but how do I access an attribute has its name stored in another variable?Suppose I have a xml element with the descriptions of my three hotspots nm1, nm2 and nm3, to be shown when I hover over them.
<description
nm1="kitchen"
nm2="bedroom"
nm3="living room"...>On the hotspot definition, I call the "find description()" with the onhover.
<hotspot name="nm1", onhover="find_description()" ...>
If I define the action find_description as such:
<action name="find_description">
txtadd(hovertext,"description.", get(name()); <!-- get(name) gives me the name of the hotspot I hover, i.e. nm1 -->
trace(name);
trace(hovertext);
trace(get(hovertext));
showtext(get(hovertext));
</action>trace(name) gives me the hotspot name (i.e. nm1), which is ok.
Trace (hovertext) gives me "desription.nm1".
Trace(get(hovertext)) gives me "kitchen" and that is ok.
But showtext doesn't work like trace, showtext(get(hovertext)) still shows me "description.nm1".Is there any straightforward way to solve the problem? The only way I could think of was quite clumsy, to redefine the action to call another action act2:
<action name="find_description"> txtadd(hovertext,"description.", get(name()); act2(get(hovertext)) </action>
<action name="act2"> showtext(get(%1)) </action>This, of course, substituted desription.nm1 into %1, transforming get(%1) into get(description.nm1), which, obviously, showed "kitchen". It made it possible to apply get twice. Unfortunately, using just showtext(get(get(hovertext)) didn't work, it showed Null.
But it doubled the number of neccesary actions, it makes the code very unreadable.Thank you!