cc.Class({
    extends: cc.Component,

    properties: {
        label: {
            default: null,
            type: cc.Label
        },
  
        text: 'Hello, World!',
        skeletonAnimation:cc.SkeletonAnimation,
    },

    onLoad: function () {
        this.label.string = this.text;

        let skeletonAnimation = this.skeletonAnimation;
        let animState = skeletonAnimation.play();
        animState.wrapMode = cc.WrapMode.Loop;
        animState.repeatCount = Infinity;
        animState.speed = 1;
        skeletonAnimation.on("finished", function (event) {
           console.log("finished");
        }, this);
    },
});
