Last active
August 29, 2015 14:02
-
-
Save tmskst/100a1160590a16b41e7f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function () { "use strict"; | |
var Main = function() { }; | |
Main.main = function() { | |
var vTimes = 2; | |
var timeline = jsfl.Lib.fl.getDocumentDOM().getTimeline(); | |
var _g1 = 0; | |
var _g = timeline.layerCount; | |
while(_g1 < _g) { | |
var layerIndex = _g1++; | |
var layer = timeline.layers[layerIndex]; | |
timeline.setSelectedLayers(layerIndex); | |
var frameIndex = 0; | |
while(frameIndex < layer.frameCount) { | |
var frame = layer.frames[frameIndex]; | |
if(frameIndex == frame.startFrame) timeline.insertFrames(frame.duration * (vTimes - 1),false,frameIndex); | |
frameIndex = frameIndex + 1; | |
} | |
} | |
}; | |
var jsfl = {}; | |
jsfl.Lib = function() { }; | |
jsfl.Lib.fl = fl; | |
Main.main(); | |
})(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import jsfl.Frame; | |
import jsfl.Layer; | |
import jsfl.Lib.fl; | |
class Main { | |
public static function main() { | |
var vTimes:Int = 2; | |
var timeline = fl.getDocumentDOM().getTimeline(); | |
for (layerIndex in 0...timeline.layerCount) { | |
var layer:Layer = timeline.layers[layerIndex]; | |
timeline.setSelectedLayers(layerIndex); | |
var frameIndex:Int = 0; | |
while (frameIndex < layer.frameCount) { | |
var frame:Frame = layer.frames[frameIndex]; | |
if (frameIndex == frame.startFrame) { | |
timeline.insertFrames(frame.duration * (vTimes - 1), false, frameIndex); | |
} | |
frameIndex = frameIndex + 1; | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment