3 Replies Latest reply on May 18, 2016 10:17 AM by ClayUUID

    Timeline duration

    alessiop62030307

      Hello!

       

      I'm working with canvas/Js in Animate CC

       

      Is it possible to get the duration of timeline (second or frames)? I have to make a progress bar, but i haven't any idea about this. Someone can help me?

       

       

      Thanks!

        • 1. Re: Timeline duration
          kglad Adobe Community Professional & MVP

          you can use the currentFrame and totalFrames properties of movieclips to do that.

           

          for example, for a horizontal progress display (progress_bar with fill_mc where fill_mc has left side reg point);

           

          var tl=this;

          var mc = this movieclip whose timeline play-progress you wish to display

          createjs.Ticker.addEventListener('ticker',f);

           

          function f(e){

          tl.progress_bar.fill_mc.scaleX=tl.mc.currentFrame/tl.mc.totalFrames;

          }

          1 person found this helpful
          • 2. Re: Timeline duration
            nezarov Level 4

            trace(totalFrames);

            trace(totalFrames/24);

            trace(mcName.totalFrames/24);

            • 3. Re: Timeline duration
              ClayUUID Adobe Community Professional

              Maybe it's been fixed by now, but when I first tried doing this sort of thing, I found the "official" properties to not be reliable. That's why I use these instead:

               

              this.timeline.position (instead of this.currentFrame)

              this.timeline.duration (instead of this.totalFrames)

              1 person found this helpful