MovieClip assets SWC from Flash inaccessible in Flash Builder using getDefinitionByName

瘦欲@ 提交于 2019-12-14 02:42:48

问题


I need to access MovieClips from an SWC created in Flash using getDefinitionByName() in Flash Builder. I know I have to add in the full package name whilst doing this, like so, with the package name being 'com.fusepump':

var className:String,
    assetName:String,
    obj:Class,
    i:uint;

for (i = 0; i < Config.ASSETS.length; i ++)
{
    className = String('com.fusepump.' + Config.ASSETS[i]);

    assetName = String(Config.ASSETS[i]).charAt(0).toLowerCase() + String(Config.ASSETS[i]).substr(1, String(Config.ASSETS[i]).length);

    obj = getDefinitionByName(className) as Class;

    _assets[assetName] = new obj();
}

The problem is that I don't seem to have any control of the package name in the SWC exported from Flash. In the Referenced Libraries directory the MovieClips are under Assets.swc/default package/Asset_1.abc - If I were able to add it to a named package the problem would be solved.


回答1:


I had such problems too. Try this solution Flash Builder - How to build or include an SWC you can build SWC in flashBuilder. The ones from flash ide are wierd to use in FlashBuilder.



来源:https://stackoverflow.com/questions/22647257/movieclip-assets-swc-from-flash-inaccessible-in-flash-builder-using-getdefinitio

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!