Universal tween action for hotspot

  • Hi All,

    I'm struggling with a bit of code in a project. I'm loading several hotspots in a virtual tour and I want them to draw attention with a little motion tween, in this case a 'hartbeat'.

    I wrote a little action for one of the hotspots but now I want to make the action universal to all hotspots without mentioning the specific hotspot names in the action itself.

    I want to use the following flow:
    This action is loaded in the hotspot-style with onloaded="beat-spots();"
    This action is replaced by another motion tween with an onhover=" ;"
    This action has to be loaded again with an onout=" ;"

    I tried to fix this with something like: tween(hotspot(get(name)).scale, ... ... ... but the get-function doesn't work. As far as I understand the code this seems quite logical because the get will result in a null since there is no hotspot available on an onOut situation.

    But, is it possible to rewrite this little piece of code to a repeating and universal action for all hotspots in a tour and with dynamic names?

    See the projectlink: https://krpano.com/forum/wbb/www.…/supernova.html
    See the the code below:

    Code
    <action name="beat-spots">
    tween(hotspot[hotspotname].scale, 0.5, 1, default,	
    delayedcall(0.5,	
    tween(hotspot[hotspotname].scale, 0.4, 1, default,	
    delayedcall(0.3,
    beat-spots();	
    ); ); ); ); 
    </action>
  • Hi,

    any action code that will be called from plugin/hotspots events can access the plugin/hotspot properties directly.

    e.g. this code:

    Code
    <hotspot name="hs1" ... scale="1.0" ... onclick="test();" />
    
    
    <action name="test">
      trace(name);
      tween(scale,2.0);
    </action>

    will show the name of the calling hotspot in the krpano log:

    Code
    INFO: hs1

    and tween it's scale to 2.0.

    Best regards,
    Klaus

Jetzt mitmachen!

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