Skip to main content
Participant
February 16, 2022
Question

how to move the playhead ONE frame at a time

  • February 16, 2022
  • 1 reply
  • 210 views

So I have made this code so i can move the playhead one frame at a time. But it does not seem to be working?? It use to work just fine, not sure what has happened.

var doc = fl.getDocumentDOM();
var t = doc.getTimeline();
var l = t.layers[t.currentLayer];
var play = t.currentFrame;

t.currentFrame = (l.frames[play].startFrame === play && play > 0) ? l.frames[play-1].startFrame : l.frames[play].startFrame;



Im not interested in moving from one SET keyframe to another.

    This topic has been closed for replies.

    1 reply

    Participant
    February 16, 2022

    this was for the next frame

    var doc = fl.getDocumentDOM();
    var t = doc.getTimeline();
    var l = t.layers[t.currentLayer];
    var play = t.currentFrame;

    t.currentFrame = l.frames[play].startFrame + l.frames[play].duration;

    and for previous frame is as in main msg