3 Replies Latest reply on Nov 14, 2016 7:56 AM by ClayUUID

    Animate CC HTML5 Canvas - loop X times and then stop mid animation, not on endframe

    laurens47891653 Level 1

      Hi,

       

      Been searching online for hours and can't find an answer to this? Surely other people are having the same problem?

       

      Trying to create a simple HTML5 Canvas ad animation, Adobe CC Animate.

       

      Frame 0 (START)

      |

      |

      Frame 50 (Endframe)

      |

      |

      Frame 60 (Endframe fades out to white so the animation can loop nicely)

       

      The only resources I can find are telling me to put this on the last frame:

       

      if(!this.alreadyExecuted){

      this.alreadyExecuted=true;

      this.loopNum=1;

      } else {

      this.loopNum++;

      if(this.loopNum==3){

      this.stop();

      }

      }

       

      But this just loops the whole timeline from Frame 0 to 60. That means my endframe would just be a solid white empty panel (the fadeout).

       

      Anyone have any ideas? I think it needs to be something like:

       

      Frame 0 (START)

      |

      |

      Frame 50 (Endframe) If loop =<2, continue playing. If loop = 3, stop here.

      |

      |

      Frame 60 If loop =<2, go to frame 0 + play.

       

      Many thanks in advance!

       

      Lauren