Hi, I have a sprite image sequence of 5 frames that starts playing and then stops on the last frame, I want to get it playing backwards after that, from frame 5 to frame 0! I tried but noway! Could someone please let me know how to do it from klaus animation code:
<action name="do_crop_animation" scope="local" args="framewidth, frameheight, framerate">
<!-- define local variables -->
calc(local.xframes, (caller.imagewidth /framewidth) BOR 0);
calc(local.frames, xframes * ((caller.imageheight / frameheight) BOR 0));
def(local.frame, integer, 0);
<!-- set the first frame -->
calc(caller.crop, '0|0|' + framewidth + '|' + frameheight);
<!-- do the animation -->
setinterval(calc('crop_anim_' + caller.name), calc(1.0 / framerate),
if(caller.loaded,
inc(frame);
if(frame GE frames, set(frame,4);clearinterval(calc('crop_anim_' + caller.name)); );
mod(xpos, frame, xframes);
div(ypos, frame, xframes);
Math.floor(ypos);
mul(xpos, framewidth);
mul(ypos, frameheight);
calc(caller.crop, xpos + '|' + ypos + '|' + framewidth + '|' + frameheight);
trace(scoubidou);
,
<!-- stop the interval when the hotspot gets removed -->
clearinterval(calc('crop_anim_' + caller.name));
);
);
</action>
Thank you so much!