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 !

  • 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 ?

  • 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>

  • 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 !

  • 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

  • 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.

  • 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:
    https://krpano.com/forum/wbb/inde…rd.subscription

    Best regards,
    Klaus

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!