Created
December 22, 2014 09:13
-
-
Save Hoikohroh/f5a42b531184410ad6ce to your computer and use it in GitHub Desktop.
Flash script(jsfl) : SpliceFrames
This file contains 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
/* | |
Adobe Flash Script (JSFL) | |
SpliceFrames | |
v20141222 | |
Script summary | |
01 : remove selected frames | |
02 : fill removed frames (fill frames are one before deleted frames) | |
*/ | |
var tl = fl.getDocumentDOM().getTimeline(); | |
var selectedFrames = tl.getSelectedFrames(); | |
spliceFrames(); | |
//Functions// | |
function checkArray3n(array){ | |
if((array.length % 3) === 0 && array.length !== 0){ | |
return (array.length/3) | |
}else{ | |
return false | |
}; | |
} | |
function spliceFrames(){ | |
if(checkArray3n(selectedFrames) === 1 && selectedFrames[1] !== 0){ | |
var numNow = tl.currentFrame; | |
var numLay = selectedFrames[0]; | |
var numStart = selectedFrames[1]; | |
var numEnd = selectedFrames[2]; | |
tl.removeFrames(); | |
tl.insertFrames((numEnd - numStart), false, (numStart - 1)); | |
tl.setSelectedFrames([numLay,numStart,numEnd],true); | |
tl.currentFrame = numNow; | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment