到底如何动态创建龙骨动画???

cc.loader.loadResAll(‘db’, function (err, assets) {
let node = new cc.Node(‘1213’);
self.node.addChild( node, 99999 );
node.setPosition( cc.p( 200, 200 ) );
let armatureDisplay = node.addComponent(dragonBones.ArmatureDisplay);

for ( let i = 0; i < assets.length; i++ ) {
    if (assets[i] instanceof dragonBones.DragonBonesAsset) {
        armatureDisplay.dragonAsset = assets[i];
    }

    if (assets[i] instanceof dragonBones.DragonBonesAtlasAsset) {
        armatureDisplay.dragonAtlasAsset = assets[i];
    }
}
armatureDisplay.armatureName = 'mecha_1502b';
armatureDisplay.playAnimation('idle', -1);

});

这样根本不显示 cc.log(armatureDisplay.armature()); 都是null 就算显示这怎么操作动画? 到底怎么动态创建龙骨动画???

上面代码没错 查了查 白鹭 加载龙骨 发现 armatureDisplay.armatureName 并不是最外层的 name 是 armature 下的name!!名字弄错了 真心累!

this.factory = new dragonBones.CCFactory();
this._dragonBonesData = this._factory.parseDragonBonesData(dragonBonesJsonString);
this._factory.parseTextureAtlasData(atlasJsonString, imageFilePath);
var dragonBonesNode = this._factory.buildArmatureDisplay(armatureName);