Skip to main content
Participant
December 12, 2024
Question

How execute a animate only 2 times ?

  • December 12, 2024
  • 1 reply
  • 266 views

Hello guys, how i can execute only 2 times a animation?, i use "stop();" when i need to see the animation only 1 time, but what command i need to use for do this only 2 times?.

Thanks mates.

    This topic has been closed for replies.

    1 reply

    JoãoCésar17023019
    Community Expert
    Community Expert
    December 12, 2024

    Hi.

     

    One approach would be to place a code like this in the last frame of the animation:

    if (this.started)
        stop();
    this.started = true;

     

    Or, if your animation is within a Graphic symbol, you can extend it on the main timeline to last 2x its internal duration, set it to loop in the Properties panel and add a single stop in the last frame of the main timeline.

    Regards,
    JC

    Participant
    December 12, 2024

    Thank you!

    JoãoCésar17023019
    Community Expert
    Community Expert
    December 12, 2024

    You're welcome!