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

Loop part of an animation

Explorer ,
Jun 14, 2017 Jun 14, 2017

I have a presentation that contains 5 images. I want the presentation to start at image one and run to image five. I then want it to loop back to image TWO and then run to image five and then loop forever. So basically, image one only appears once, at the start. How do I do that? Thanks.

.

2.7K
Translate
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

Adobe Employee , Jun 14, 2017 Jun 14, 2017

Your file plays absolutely fine on my machine without changing anything.

How are you previewing the animation?

use Ctrl + Enter to preview the animation on browser.

Translate
Adobe Employee ,
Jun 14, 2017 Jun 14, 2017

You simply have to go to the last frame, open Actions panel (Windows menu > Actions) and write a line of code over there.

this.gotoAndPlay(2);          (for Actionscript 3.0 files), or

this.gotoAndPlay(1);          (for HTML5 Canvas files)

Translate
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
Explorer ,
Jun 14, 2017 Jun 14, 2017

Sorry - being thick; how do I set it up to return the playhead to the specific frame? Say I want it to go back to frame 25 and then loop continuously from there? Thank you for your answer.

Translate
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
Adobe Employee ,
Jun 14, 2017 Jun 14, 2017

this.gotoAndPlay(FrameNumber);

  or

this.gotoAndPlay('Label');

Translate
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
Explorer ,
Jun 14, 2017 Jun 14, 2017

I have opened my presentation and selected the final frame (frame 40).

I have opened the Actions Window and typed "this.gotoAndPlay(25);" (not in quotes). Frame 25 is where I want to loop from.

In the Actions panel, on the left side it reads:

Scene 1

  Layer 1 : Frame 40

Do I have to pin it (I tried but nothing happened)?

In the fame itself, it now has an extra circle (not filled) above the keyframe circle (filled) underneath.

Running the file just results in it running from start to finish and stopping.

Translate
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
Adobe Employee ,
Jun 14, 2017 Jun 14, 2017

No, pinning is not needed.

Is there any other code somewhere else?

Can you share your fla file to have a quick look. You can upload it to dropbox or some other file sharing service and post the link.

Translate
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
Explorer ,
Jun 14, 2017 Jun 14, 2017

Screen Shot 2017-06-14 at 12.31.28.png

Sorry Nipun - I know I'm doing something wrong here but I don't see it. Yes - I'll gladly share the file but firstly here is what is happening; I have now given the frame I want to loop back to a label having firstly made it a keyframe. Frame 39 has also been turned into a keyframe and the script attached to it - In the top window is the script I've used. The movie plays from start to finish and then stops. Thanks for your patience. I'm using Adobe Animate v.2017.2 on a Mac (OS X 10.12.4) if that helps.

Translate
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
Adobe Employee ,
Jun 14, 2017 Jun 14, 2017

when you use frame labels instead of numbers, use quotes in the gotoAndPlay() function call.

this.gotoAndPlay('startloop');

Translate
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
Explorer ,
Jun 14, 2017 Jun 14, 2017

Screen Shot 2017-06-14 at 12.42.24.png

I was SO hoping that was the answer!! 8-0 Unfortunately, the same thing is happening, although the label appears to be recognised as it's turned green)

Translate
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
Adobe Employee ,
Jun 14, 2017 Jun 14, 2017

This looks fine,.Can you quickly share your file pls

Translate
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
Explorer ,
Jun 14, 2017 Jun 14, 2017

SendThisFile - File Download

You should be able to retrieve the file from this link.

Translate
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
Adobe Employee ,
Jun 14, 2017 Jun 14, 2017

Your file plays absolutely fine on my machine without changing anything.

How are you previewing the animation?

use Ctrl + Enter to preview the animation on browser.

Translate
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
Explorer ,
Jun 14, 2017 Jun 14, 2017

How frustrating!! I was playing it within Animate itself - everything works fine in it apart from the looping part. However, as you say, I can now see that this is working properly in my browser (and I can't thank you enough for getting me this far!!!!!). Why would Animate not preview it properly - if I do a standard loop, that works. Thank you.

Translate
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 ,
Jun 14, 2017 Jun 14, 2017

Animate "previews" perfectly well... when you press Ctrl-Enter. What it does not do is run script code while in the editor. That would be an insanely bad idea. The last thing anyone would want would to be fighting gotoAndPlays while trying to review an animation.

Translate
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
Explorer ,
Jun 14, 2017 Jun 14, 2017

I don't have dropbox but I use SendThisFile - where can I send it to?

Translate
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 ,
Jun 14, 2017 Jun 14, 2017
LATEST

Two things not related to you main issue:

The text turning green is just that it is now seen as a text string and not a variable. It isn't that frame labels have special significance, any text inside quotes will show in green.

You can add other layers, and it's usually a good idea to have a layer dedicated to the scripts you're adding. That layer would still have. keyframe in frame 39, where the code would be, but it would mean that your last picture would not have a keyframe, it would go from frame24 to 39 like it originally did. It won't cause any problems in this particular case, but there's no advantage in putting in a keyframe where it isn't needed.

Translate
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