You are not logged in.

1

Tuesday, January 7th 2014, 8:00pm

Gif not playing

I have put this gif in my tour but I can't get it to rotate, what am I doing wrong?

I am using this code:

Source code

1
<hotspot name="test_gifer" url="images/test.gif" keep="true"    scale="1"  distorted="true"/>



If there is no simple way of "animating" the gif I was wondering if there is a way to controll how fast the hotspot animation updates the frames as seen in this example:

Source code

1
<style name="hotspot_ani_black" enabled="false"	       url="images/hotspot_ani_black_64x64x20.png" alpha="0"	       crop="0|0|64|64" zorder="2" keep="true"	       framewidth="64" frameheight="64" frame="0" lastframe="19"	       onloaded="hotspot_animate();"	       />



I have made a version with the gif as the hotspot png but it rotates too fast.

Help is appreciated *thumbsup*

2

Wednesday, January 8th 2014, 10:21am

Hi,

Animated-gifs are not supported in Flash.
In HTML5 they would work but are not recommended - in many browsers they perform worse compared to xml-animated png hotspots.

Regarding speed control of xml animated hotspot - look into the 'hotspot_animate' action - it contains a 'delayedcall' with a time value (e.g. 0.03) - this is the time in seconds between the frames.

Best regards,
Klaus

3

Thursday, January 9th 2014, 10:31am

Thank you for the reply Klaus, I did alter the delay but for me nothing happened, it was just a delay of when the animation would begin. Or is it only like that when testing offline?

Alexey Tkachenko

Professional

Posts: 770

Location: Russian Federation

Occupation: Interpreting, Building virtual tours

  • Send private message

4

Thursday, January 9th 2014, 10:37am

Hi! Are you sure you changed what Klaus meant?

Here's the action:

Source code

1
2
3
4
5
6
<action name="hotspot_animate">
		inc(frame,1,get(lastframe),0);
		mul(ypos,frame,frameheight);
		txtadd(crop,'0|',get(ypos),'|',get(framewidth),'|',get(frameheight));
		delayedcall(0.03, if(loaded, hotspot_animate() ) );
	</action>


if you change this line:

Source code

1
delayedcall(0.03, if(loaded, hotspot_animate() ) );

to

Source code

1
 delayedcall(0.2, if(loaded, hotspot_animate() ) ); 


You will see that animation works slower.
Regards,

Alexey

5

Thursday, January 9th 2014, 10:51am

Got it to work now, I forgot to also change the parameter after the delayedcall. Thanks for the help!