Sie sind nicht angemeldet.

1

Donnerstag, 14. Juli 2011, 12:25

hotspot scale animation

I have scale animation hotspot with this style:

Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
13
 <style name="nav_hotspot_anim"
  url="skin/arrow.png" 
  alpha="0.3"
  distorted="true"
  scale="1"
  scalemax = "1.2"
  animation = "true"
  incr = "true"
  keep="false"     
  onloaded="nav_animate(get(name)));"
  onover="tween(alpha,1);tween(scale,1.3); set(animation, false); toggle_autorotate(false);"
  onout="tween(alpha,0.6); set(animation, true); toggle_autorotate(true); nav_animate(get(name));" 
  />


I have some hotspots with the Identical names
in different scenes, when i move from scene to the scene and back with Identical hotspot names, the speed of animation was doubled. How i can to resolve this problem without to rename hotspots?

2

Donnerstag, 14. Juli 2011, 17:58

Hi,

please show also the code of your "nav_animate" action,
the problem may be located there,

when the speed was doubled it could be that now something will be called two-times,

best regards,
Klaus

3

Freitag, 15. Juli 2011, 09:36

Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
 <action name="nav_animate">
  trace('ACTION: nav_animate[',get(name),'] scale=', get(hotspot[get(name)].scale),' animation=',hotspot[%1].animation); 
  ifnot(hotspot[%1].scale === null,
  if(hotspot[%1].animation === true, _nav_animate(%1));
  );
        </action>
 <action name="_nav_animate">
  if(hotspot[%1].incr === true,
   if(hotspot[%1].scale GT hotspot[%1].scalemax , set(hotspot[%1].incr, 'false'));
          inc(hotspot[%1].scale,0.02)
  );
  if(hotspot[%1].incr === false,
   if(hotspot[%1].scale LT 1, set(hotspot[%1].incr, 'true'));
          dec(hotspot[%1].scale,0.02)
  );
  delayedcall(0.09, nav_animate(%1));
       </action>

4

Samstag, 23. Juli 2011, 12:02

Hi,

okay, there is no stop condition for the case when the hotspot was removed,
so the actions will be called again and again, even when the original hotspot was already removed,
and when there is now revisit of that pano with the same hotspots and action, they will be called twice and more,

but there is a easy solution, the attributes of the source/first calling hotspot can be always accesses directly, so it would be possible to check a variable from there (e.g. the loaded variable) before doing the delayedcall,

e.g.
instead of:

Quellcode

1
delayedcall(0.09, nav_animate(%1));


do this:

Quellcode

1
if(loaded, delayedcall(0.09, nav_animate(%1)));


best regards,
Klaus