How to get the current position (frame) of a movie clip in EaselJS?

I have a MovieClip that fades and then fades. I would like to find half the mark in this clip and pause it. However, in EaselJS I cannot find a way to get the current frame position in the clip. Is it possible?

I would like to do something like the following:

 canvas = document.getElementById("introCanvas");
        exportRoot = new lib.MyMovieClip();
        exportRoot.onTick = function () {

            //get the mc length in frames
            //get the current frame position
            //if current frame postion == mc lenght / 2
                   //then pause movie clip


        };

Can someone provide me some suggestions or ideas on how I could accomplish the above?

Thank!

+3
source share
2 answers

After reading the documentation, it seems that animation is automatically allocated to control the change TweenJS Timeline, it seems that there are no real frames that we see in flash.

docs for TweenJS Timeline, duration, :

, ( , useTicks - ). . . UpdateDuration .

, 2 0,5;), . onTick, , .

0

...

(movieclip.timeline.position)%movieclip.timeline.duration

...

var tl = movieclip.timeline;
var d = timeline.duration;

(tl.position)%d

%. .

0
source

All Articles