Start a new topic


I am using AR.AnimatedImageDrawable object with animate method with array of keyframes. But i want to reset the animate method, to play keyframes from start.

 Additional details sent by customer via email:

Below is the code in which i am using AR.AnimatedImageDrawable object with animate method .

But i want to reset the animate method so that the keyframes will start from beginning.
Kindly let me know if there is any method to reset the animate method.

for(var i=0;i<storyCount;i++) // in function
{   //storyImage[i]
storyAnimatedObject[i] = new AR.AnimatedImageDrawable(new AR.ImageResource(storyImage[i]),parseFloat(spriteHeight[i]),parseInt(spriteKeyFrameWidth[i]),parseInt(spriteKeyFrameHeight[i]),{
offsetX: spriteoffsetX[i],
offsetY: spriteoffsetY[i],

Hello Tarun,

what about this one: setKeyFrame.

- Daniel

Hi Daniel,

Thanks for reply.

Actually the the setKeyFrame will stop the keyframe at perticular location. But i want to start the array of images from starting position. 

Hello Tarun,

I believe what you'd need to call in that case is the animate method with an array of increasing integer values starting at zero. Something like this:


animatedImageDrawable.animate([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, ...], ...);


The code snippet you provided does not show the content of the mainStoryAnimationArray variable. If your animation does not start at the first frame, I suspect it to not contain increasing integer numbers starting at 0.

Have you logged the content of that variable to see what's inside exactly?

- Daniel

Thank You Daniel.

Login or Signup to post a comment