hotspot animation start / stop

  • Hi

    i would like animation start boutton and animation stop boutton

    if i click on plugin animation start but if click bstart button , not work

    help please


  • Hi,

    the 'hotspot_animate' action loops itself by call itself by a delayedcall,
    see here:

    Code
    delayedcall(0.1, hotspot_animate() );

    to be able to stop that process you can define an additionally custom variable and check for this variable before doing the delayedcall,

    e.g.

    Code
    if(anistopped == false, delayedcall(0.1, hotspot_animate() );)

    and add - anistopped="false" - to the <plugin> definition of the hotspot,

    for stopping the animation just set:

    Code
    set(hotspot[spotname].anistopped,true);

    when it should be started again - from an action from another hotspot or plugin element, then the 'hotspot_animate' needs first to be rewritten to use 'absolute variable paths',
    e.g.

    Code
    <action name="hotspot_animate">
    inc(hotspot[%1].frame,1,get(hotspot[%1].lastframe),0);
    mul(ypos,hotspot[%1].frame,hotspot[%1].frameheight);
    txtadd(hotspot[%1].crop,'0|',get(ypos),'|',get(hotspot[%1].framewidth),'|',get(hotspot[%1].frameheight));
    delayedcall(0.1, hotspot_animate(%1) );
    </action>

    and then the 'hotspot_animate' action must be called with the name of the hotspot that should be animated,
    e.g.
    to start the animation:

    Code
    set(hotspot[spotname].anistopped, false);
    hotspot_animate(spotname);

    best regards,
    Klaus

  • Hello! How can you stop the animation of one button? Here is my code:

    Code
    <style name="gerlstyle"	 url="sex25.png"	 crop="0|0|500|500"	 framewidth="500"  frameheight="500" frame="0" lastframe="25"		      	       />
     <action name="gerl_play" > inc(frame,1,get(lastframe),0);	 mul(ypos,frame,frameheight);	 txtadd(crop,'0|',get(ypos),'|',get(framewidth),'|',get(frameheight));	 delayedcall(0.06, if(loaded, gerl_play() ) );	 </action>	 <action name="gerl_stop"> stopall();	</action>	
    <hotspot name="gerl_hotspot"  style="gerlstyle"  ath="-3.65074"  atv="1.586068"  width="400" height="400"  distorted="true"	 visible="true"  stopspotsequence="false"	onclick="    if (gerl_hotspot!= 1,    set(gerl_hotspot,1);gerl_play(); ,    set(gerl_hotspot,0);gerl_stop(););"/>


    everything works, but when "stopall();", stop all the other action ... how to stop only the desired hotspot?

  • either use a 'named' delayedcall (that means adding an unique name/id as first parameter) and than call stopdelayedcall() with that name/id,

    Thank you! Everything worked out! Here is my code:

    Code
    <action name="gerl_play" >		inc(frame,1,get(lastframe),0);		mul(ypos,frame,frameheight);		txtadd(crop,'0|',get(ypos),'|',get(framewidth),'|',get(frameheight));		delayedcall(introimage, 0.06, gerl_play() );		        	</action>		<action name="gerl_stop">			stopdelayedcall(introimage);	</action>
  • Hello! how to make an animation in the opposite direction? not from 0 to 16, but vice versa (16,15,14,13 ......). Here is my code:

    Code
    <action name="crok_play" >inc(frame,1,get(lastframe),0);mul(ypos,frame,frameheight);txtadd(crop,'0|',get(ypos),'|',get(framewidth),'|',get(frameheight));delayedcall(crokimage, 0.1, crok_play() ); </action>

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!