Flash资源的自动进口/重命名 [英] Automated importing/renaming of Flash assets

查看:173
本文介绍了Flash资源的自动进口/重命名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以,我有很多的资产,大约1000在当时是一个AS3闪存项目,但后来可能会扩展到几千个。他们都是图片,但其中一半是GIF动画,所以我不能在运行时导入。我考虑干脆将其拖至闪存项目,但我似乎没有有过的命名方案任何控制。基本上,我想知道的是:

So I have an AS3 flash project with A LOT of assets, roughly 1000 at the time being but that may expand to several thousand later. They are all images but half of them are Animated GIFs so I can't import them at runtime. I considered simply dragging them into the flash project but I don't seem to have any control over the naming scheme. Basically, what I want to know is:

有没有一种方法来自动导入和闪存资产的重命名,如导入这些1000个文件,并将其与该名称为ActionScript导出?

Is there a way to automate importing and renaming of flash assets, like "Import these 1000 files and export them for Actionscript with this name"?

此外,有没有更好的办法,我必须这样做?我试着 HTTP://$c$c.google.com/p/as3gif/ AS3GIF但它具有较大GIF动画像那些我正在与(650x450)的斗争。任何帮助将是AP preciated。

Additionally, is there a better way for me to be doing this? I've tried http://code.google.com/p/as3gif/ AS3GIF but it struggles with larger animated gifs like the ones I'm working with (650x450). Any help would be appreciated.

推荐答案

JSFL是你的朋友。 JSFL是Flash IDE的脚本语言,就可以自动完成很多事情,例如,重命名所有的lib片段:

Jsfl is your friend. Jsfl is Flash IDE script language, you can automate a lot of thing, for example, rename all lib clip :

function main()
{
    var DOM = fl.getDocumentDOM();
    var lib = DOM.library.getSelectedItems();

    searchedClip = prompt("Search in clip name :");
    if(searchedClip == null) return;

    replaceClip = prompt("Replace by :");
    if(replaceClip == null) return;

    fl.outputPanel.clear();

    nbRes = 0;
    for(var i =0; i < lib.length; ++i)
    {
        name = lib[i].name.split("/");
        name = name[name.length-1];
        nIndex = name.toUpperCase().indexOf(searchedClip.toUpperCase());
        if(nIndex != -1)
        {
            ++nbRes;
            fl.trace(lib[i].name);
            lib[i].name = name.substring(0,nIndex) + replaceClip + name.substring(nIndex+searchedClip.length);
        }
    }
    if(nbRes) fl.trace("\n"+nbRes+" results");
    else fl.trace("no result");
}
main();

看闪光灯IDE文档(http://livedocs.adobe.com/flash/9.0/main/flash_cs3_extending.pdf对CS3的Flash IDE版本)

Look Flash IDE doc (http://livedocs.adobe.com/flash/9.0/main/flash_cs3_extending.pdf for CS3 Flash IDE Version)

这篇关于Flash资源的自动进口/重命名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆