Sie sind nicht angemeldet.

1

Montag, 5. Juni 2017, 17:28

tween a hotspot only on startup

Hi,

I try to tween the size of one unique hotspot, juste once, when the pano is loaded.

I thought that this would work:

<events onloadcomplete="tween(scene[scene1].hotspot[spot1].scale, 1.5)"/>

But it doesn't. I have two quesitons:

1) Is it possible to select a hotspot whithin a scene in an absolute way, like I'm trying to do ? if yes, what's the correct syntax. I cannot find an answer in the documentation.
2) If it's not possible, how can I achieve this feature differently ?

Thank you very much !

Beiträge: 1 120

Wohnort: Angers - France

Beruf: 360 experiences creator

  • Nachricht senden

2

Montag, 5. Juni 2017, 18:48

Of course, just use the onloadcomplete event in your scene :
<scene name...>
<events onloadcomplete="tween(hotspot[spot1].scale,1.5)"/>
</scene>

3

Montag, 5. Juni 2017, 19:14

Thanks Jérôme,

I've tried that but then there is a problem: The tweening happen on every pano where a hotspot is named [spot1]. So then I tried to give a specific name to this specific hotspot. But then the tweening happens each time I navigate to this pano. And I want the tweening to happen juste once, when the virtual tour is done loading.. You see what I mean ?

Beiträge: 1 120

Wohnort: Angers - France

Beruf: 360 experiences creator

  • Nachricht senden

4

Montag, 5. Juni 2017, 19:38

Thanks Jérôme,

I've tried that but then there is a problem: The tweening happen on every pano where a hotspot is named [spot1]. So then I tried to give a specific name to this specific hotspot. But then the tweening happens each time I navigate to this pano. And I want the tweening to happen juste once, when the virtual tour is done loading.. You see what I mean ?


If you use a name for the event and don't set keep to true then this event should be executed only in that scene, and to execute only once then just set it to null after :

<scene name...>
<events name="first_time" onloadcomplete="tween(hotspot[spot1].scale,1.5);set(events[first_time].onloadcomplete,null)"/>
</scene>

5

Montag, 5. Juni 2017, 20:54

Thanks, that worked !

Though, I'm a bit surprised that it's not possible to select an element in such an absolute way:

scene[scene1].hotspot[spot1]

But well, I guess I'll have to get used to it ;)

Merci bien et bonne soirée !

6

Dienstag, 6. Juni 2017, 15:09

Hi,
Though, I'm a bit surprised that it's not possible to select an element in such an absolute way:

scene[scene1].hotspot[spot1]
That's related to the special <scene> behavior - they are only something as 'inline-xml' files:
https://krpano.com/docu/xml/#scene

The inner content of <scene> elements will not get parsed to objects until loaded via loadscene(), this is done dune memory and performance reasons.

Best regards,
Klaus

7

Donnerstag, 15. Juni 2017, 14:37

Thanks for this feedback Klaus, I have a better understanding of the logic behind it now *thumbup*

Off topic question, but do you think it would be possible to enable an e-mail notification system on this forum ? I would find convenient to be notified when someone answer my own post, or post in which I have participated. With this new internet trends, I'm so used to be notified for everything that I sometimes miss things on this forum.

8

Montag, 19. Juni 2017, 10:03

Off topic question, but do you think it would be possible to enable an e-mail notification system on this forum ? I would find convenient to be notified when someone answer my own post, or post in which I have participated. With this new internet trends, I'm so used to be notified for everything that I sometimes miss things on this forum.
The forum software provides that's already - please see here:
http://krpano.com/forum/wbb/index.php?pa…rd.subscription

Best regards,
Klaus