Skip to content

Instantly share code, notes, and snippets.

@Hoikohroh
Created December 22, 2014 09:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Hoikohroh/f5a42b531184410ad6ce to your computer and use it in GitHub Desktop.
Save Hoikohroh/f5a42b531184410ad6ce to your computer and use it in GitHub Desktop.
Flash script(jsfl) : SpliceFrames
/*
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