请教一个button问题

我已经在场景中设置了一个按钮,希望把脚本Button a挂到这个按钮上,实现点击4次 文本框变化4次,但始终报错(这已经是我最大程度修改了)

// Button a
cc.Class({
extends: cc.Component,
properties: {
atext:‘a:’,
i : 0,
a : cc.string[‘回应1’,‘回应2’,‘回应3’,‘回应4’],
},
onLoad: function () {
this.node.getChildByName(“labela”).string = this.atext;
},
buttona:function(){
this.node.getChildByName(“labela”).string = a[i]
i++;
},

});

试试this.node.getChildByName(“labela”).getComponent(cc.Label).string

getChildByName()是按照name获取节点 cc.label是组件, 得到节点之后还得获取当前节点的label组件才能string = ‘xxx’,建议加强基础学习,这种问题就不用在论坛上提问了。