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

How to play and stop frames using code snippets

Guest
May 01, 2019 May 01, 2019

I know there is a function in Animate that allows you to Play and Stop or Play and Go on certain frames, but I'm not entirely sure how to get it working properly. It's hard to explain but, using code snippets, how can I make it so when a user clicks on a particular instance it will play for X amount of frames and stop at frame Y? Or how do I make it so it'll play for the amount of frames this instance has and stop when its frames has ended? Do I use the options in the Actions folder in the Code Snippets or in the HTML5 Canvas folder? Sorry if this is unclear, I am still unsure how to properly explain this.

1.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

LEGEND , May 01, 2019 May 01, 2019

If using AS3

add a layer. name it label

add another layer

name it actions

on the action layer select frame 1 then press F9 to get the action panel then add stop();

then select frame 2 press F7 to create an empty frame. then on the right panel property enter the name of the label.

then go to the frame you want to stop next - press F7 then add stop() in the actions

and so on.

In HTML5

use this.stop(); instead of just stop();

timeline.jpg

Translate
LEGEND ,
May 01, 2019 May 01, 2019

You need to put stops on the timeline either of your symbol or your main timeline where the symbols reside. You can add labels after the stop for example and use the click event to play from these frames when desired.

for example

frame0 stop

frame1 label start

frame 10 stop

frame11 label section1

frame 25 stop

frame 26 label section2

and so on.

I am sure there are other ways that real animators which I am not would use.

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
Guest
May 01, 2019 May 01, 2019

do you know how i can add these labels/stops?

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 ,
May 01, 2019 May 01, 2019

If using AS3

add a layer. name it label

add another layer

name it actions

on the action layer select frame 1 then press F9 to get the action panel then add stop();

then select frame 2 press F7 to create an empty frame. then on the right panel property enter the name of the label.

then go to the frame you want to stop next - press F7 then add stop() in the actions

and so on.

In HTML5

use this.stop(); instead of just stop();

timeline.jpg

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 ,
May 01, 2019 May 01, 2019
LATEST

The other thing you could do is have several symbols with their own timeline animation and place them on the main timeline

with a stop for each symbol - one frame per symbol with each one its stop and its label and then play them from the main timeline. This would actually be my preferred way.

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