• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

code snippet - continuous rotation

New Here ,
Aug 16, 2017 Aug 16, 2017

Copy link to clipboard

Copied

The code snippet works but it makes the movie clip go at super-speed and even if I edit it, it doesn't change and keeps going super speed. any thoughts, suggestions?

Views

841

Translate

Translate

Report

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

correct answers 1 Correct answer

Contributor , Aug 17, 2017 Aug 17, 2017

That isn't actually going faster and faster, if it would look like it would go backwards and stop at certain points. It's going extremely fast because it is rotating 10 degrees every frame. if the framerate is set to 30, then it is rotating 300 degrees every second. So you need to use a smaller value for the rotation to make it rotate slower.

Votes

Translate

Translate
LEGEND ,
Aug 16, 2017 Aug 16, 2017

Copy link to clipboard

Copied

Since you've provided no details about what edits you've attempted, it's impossible to tell you exactly what you've done wrong.

To make a continuous rotation go slower, where it says rotation+=10; just change the 10 to a smaller number.

If the speed of the clip accelerates over time, it means you're running the rotation setup code repeatedly by looping the clip it's in. Don't do that.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Aug 16, 2017 Aug 16, 2017

Copy link to clipboard

Copied

That will happen if the code gets repeated over and over again, which causes it stack event listeners. You could prevent that from happening by adding "this.stop();" on the frame with the rotation code.

If you want to check if it is repeating the code, you can add "console.log("Repeat");" to the frame and then when you run in the browser you want to open the console by pressing F12.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 17, 2017 Aug 17, 2017

Copy link to clipboard

Copied

Here is a link:

ferrisWheel

Here is the code:

this.addEventListener("tick",fl_RotateContinuously_4.bind(this));

function fl_RotateContinuously_4(){

this.movieClip_1.rotation+=10;

}

this.stop();

Here is the output:

WARNINGS:

** 30 Bitmaps packed successfully into 1 spritesheet(s).

Frame numbers in EaselJS start at 0 instead of 1. For example, this affects gotoAndStop and gotoAndPlay calls. (2)

I'm new to Animate CC. I have used Edge Animate in the past but trying to learn this new environment. Any help is so much appreciated. Thank you, Kristen

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Aug 17, 2017 Aug 17, 2017

Copy link to clipboard

Copied

That isn't actually going faster and faster, if it would look like it would go backwards and stop at certain points. It's going extremely fast because it is rotating 10 degrees every frame. if the framerate is set to 30, then it is rotating 300 degrees every second. So you need to use a smaller value for the rotation to make it rotate slower.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 17, 2017 Aug 17, 2017

Copy link to clipboard

Copied

that did it.... put it at .5   Thank you!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 17, 2017 Aug 17, 2017

Copy link to clipboard

Copied

LATEST

In other words, exactly what I already told you in the first reply to this thread.

Votes

Translate

Translate

Report

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