start / stop png animation won't work - please help

  • I successfuklly managed to create a png animation and because I need to trigger the start and stop of it I followed a code example from Klaus to test it.

    Unfortunately it won't start when I use a separate start button (or any other event).
    It only starts when it is triggered by clicking on the hotspot itself.
    When clicking on the start button it will move only for one step.

    I've been fooling around with it for hours now and can't find a solution.
    Please could someone check and see what's wrong.

    My example is here.

    Thank you very much
    Jürgen

  • Hi!
    try use hotspot[%1].anistopped instead anistopped
    try to turn on tracing this

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

    also try use delayyedcall

    among other things, I would advise you to avoid unnecessary calls to action with repeated clicks on the avatar (repeated clicks caused chaotic accelerated animation)

    Code
    <action name="start">
    set(hotspot[avatar].anistopped, false);
    ifnot(hotspot[%1].anistopped, delayedcall(0.2,animate(avatar)));
    </action>

Participate now!

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