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

stopping a rotate continuously command

New Here ,
Nov 29, 2016 Nov 29, 2016

Copy link to clipboard

Copied

Hi there!

I'm pretty much brand new to animate, and have finished a few simple animations. I'm currently working on an interactive animation of a turntable. Essentially as buttons are clicked, the machine comes on, the tone arm moves over and the record begins to spin. It was created as Action 3. And I'm now trying to code it, using the actions and code snippets within the program. The record is spinning via a rotate continuously code snippet which begins after a button is pressed, but I cannot seem to find a way to stop the rotation when another button is pushed, though I'm convinced there has to be a way. any

Any advice anyone had here would be greatly appreciated, thanks!

Views

284

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

LEGEND , Nov 29, 2016 Nov 29, 2016

If you look at the code snippet it has a line like this ('turntable' is the name I gave the movieclip, your name is most likely different):

turntable.addEventListener(Event.ENTER_FRAME, fl_RotateContinuously);

If you have made that work with a button click, it's going to be something like:

function startturning(e:MouseEvent){

turntable.addEventListener(Event.ENTER_FRAME, fl_RotateContinuously);

}

So, for the stop button have it call another function that would be like this:

function stopturning(e:Mouse

...

Votes

Translate

Translate
LEGEND ,
Nov 29, 2016 Nov 29, 2016

Copy link to clipboard

Copied

If you look at the code snippet it has a line like this ('turntable' is the name I gave the movieclip, your name is most likely different):

turntable.addEventListener(Event.ENTER_FRAME, fl_RotateContinuously);

If you have made that work with a button click, it's going to be something like:

function startturning(e:MouseEvent){

turntable.addEventListener(Event.ENTER_FRAME, fl_RotateContinuously);

}

So, for the stop button have it call another function that would be like this:

function stopturning(e:MouseEvent){

turntable.removeEventListener(Event.ENTER_FRAME, fl_RotateContinuously);

}

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 ,
Nov 30, 2016 Nov 30, 2016

Copy link to clipboard

Copied

LATEST

Colin, Thank you so much!

This worked! I put in the code you suggested and then put in a 'stop at this frame' command, and it works perfectly!!

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