all groups > flash actionscript > october 2006 >
You're in the

flash actionscript

group:

JSFL


JSFL olally
10/26/2006 8:31:39 PM
flash actionscript:
Hi all,

Can any one give me JSFL code which
1) creates keyframes
number of keyframes is equal to number of movie clips in the library
2)assign label to the keyframe
keyframe label is equal to linkage name of each movieClip
3)attach the respective movie clip from the library on to the stage , in the
respective keyframe

a)There can be 'N' number of movieclips , in different folders and sub folders
b)There is no order to create keyframes and attach movieclips on the stage
c)Duplications should be avoided

Thank you very much





Re: JSFL NSurveyor
10/27/2006 12:41:38 AM
Here you go:

var doc = fl.getDocumentDOM();
var t = doc.getTimeline();
var y = 0;
for (var x in doc.library.items) {
var item = doc.library.items[x];
if (item.itemType == 'movie clip') {
doc.addItem({x:0, y:0}, item);
t.layers[t.currentLayer].frames[t.currentFrame].name =
item.linkageIdentifier;
t.layers[t.currentLayer].frames[t.currentFrame].labelType = 'name';
t.insertBlankKeyframe();
y++;
}
}
t.removeFrames(y);
AddThis Social Bookmark Button