Controlling a loop html5

Explorer ,
Dec 12, 2020

Copy link to clipboard

Copied

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.

Views

89

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Explorer ,
Dec 12, 2020

Copy link to clipboard

Copied

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

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Explorer ,
Dec 12, 2020

Copy link to clipboard

Copied

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?

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Explorer ,
Dec 12, 2020

Copy link to clipboard

Copied

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

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
mp63178988 AUTHOR LATEST
Explorer ,
Dec 13, 2020

Copy link to clipboard

Copied

It's really amazing. At home it doesn't work. I even tried it with a clip:
app = this;
function myFontion()
{
createjs.Tween.get(app.myClip,{loop: 3})
.to({x:205, y: 180 }, 800,createjs.Ease.cubicInOut )
.to({x:205, y: 230}, 800,createjs.Ease.cubicInOut )
}

myFontion();


I don't understand and I'm very disappointed.

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more