Skip to main content
Inspiring
December 12, 2020
Question

Controlling a loop html5

  • December 12, 2020
  • 1 reply
  • 534 views

Hello,
In Animate HTML5, I've been trying for hours to solve the following problem and I don't know what to do: I would like to be able to set the number of loops to 3: why doesn't the following code work?

 

createjs.Tween.get(myPoint,{loop: 3})

Thank you very much for all the answers.

    This topic has been closed for replies.

    1 reply

    Inspiring
    December 12, 2020

    You are not animating anything in the tween. Animate properties with the .to() method, you should see these properties animated in a 3x loop.

    Inspiring
    December 12, 2020

    I didn't write all the code, just the line that doesn't work. Otherwise, I have :

    function myFontion()
    {
    createjs.Tween.get(myPoint,{loop: 3})
    .to({x:205, y: 180 }, 800,createjs.Ease.cubicInOut )
    .to({x:205, y: 230}, 800,createjs.Ease.cubicInOut )
    }

    myFunction();

    And it doesn't work. Do you have a solution?

    Inspiring
    December 13, 2020

    There is the typo with 'myFontion' not matching 'myFunction'. I fixed the typo and tested the code and it was working for me.