1

如何自动将库中使用 Classic Tween 的所有 Movie Clip (SymbolItem) 项转换为关键帧?

在此处输入图像描述

在此处输入图像描述

4

1 回答 1

1

您可以使用此JSFL脚本,Adobe Flash Professional CS4 及更高版本支持

可在此处找到文档:http: //help.adobe.com/en_US/flash/cs/extend/index.html

var document = fl.getDocumentDOM();

var library = document.library;

for (var libraryItemIndex in library.items) {
    var libraryItem = library.items[libraryItemIndex];

    fl.trace(libraryItem.name + " is " + libraryItem.itemType);

    if(libraryItem.itemType == "movie clip") {

        fl.trace(" processing movie clip");

        library.selectItem(libraryItem.name);
        library.editItem(libraryItem.name);

        var timeline = libraryItem.timeline;

        fl.trace(" contains " + timeline.layerCount + " layers");
        fl.trace(" selected layers " + timeline.getSelectedLayers());

        for (var layerIndex in timeline.layers) {
            fl.trace(" trying to select layer " + layerIndex);
            timeline.setSelectedLayers(Number(layerIndex));
            fl.trace(" converting to key frames");
            timeline.convertToKeyframes(0, libraryItem.timeline.frameCount - 1);
        }
    }
    else {
        fl.trace(" ignoring");
    }
}

输出将如下所示:

在此处输入图像描述

注意:注意方法timeline.setSelectedLayers()Number强制转换为

于 2012-11-28T15:36:36.537 回答