• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

How to determine the length of the current layer

Explorer ,
Apr 24, 2023 Apr 24, 2023

Copy link to clipboard

Copied

This jsfl can add a blank keyframe to the last frame of the current layer
But there will be an error that automatically extends to the end frame of the timeline
how to fix

if (aslayer.frameCount < tl.frameCount) {
    tl.insertBlankKeyframe(tl.frameCount);
} else {
    if (aslayer.frames[aslayer.frameCount].startFrame !== aslayer.frameCount) {
        tl.insertBlankKeyframe(tl.frameCount);
    }
}
TOPICS
ActionScript , Error , Exchange extensions , How to

Views

218

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Contributor , Apr 24, 2023 Apr 24, 2023
var doc = fl.getDocumentDOM()
var tl = doc.getTimeline()
var currentLayer = tl.currentLayer; 
var frameCount = tl.layers[(currentLayer)].frameCount;
tl.insertBlankKeyframe(frameCount -1);

Votes

Translate

Translate
Contributor ,
Apr 24, 2023 Apr 24, 2023

Copy link to clipboard

Copied

LATEST
var doc = fl.getDocumentDOM()
var tl = doc.getTimeline()
var currentLayer = tl.currentLayer; 
var frameCount = tl.layers[(currentLayer)].frameCount;
tl.insertBlankKeyframe(frameCount -1);

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines