会报错:this.bgSprite1.getPositionX();不是函数,求大神解释一下

cc.Class({
extends: cc.Component,

properties: {
    bgSprite1: {
        default: null,
        type: cc.Node
    },
    bgSprite2: {
        default: null,
        type: cc.Node
    },
    Xlabel:{
        default: null,
        type: cc.Label
    },
    
    moveSpeed: 0,       
    moveTime: 0,
},

// use this for initialization
onLoad: function () {
    
},

update: function(dt){
    this.Xlabel.string = 'X: ' + this.bgSprite1.getPositionX();
    this.BackgroundA = this.bgmoveAction();
    this.node.runAction(this.BackgroundA);
},

bgmoveAction: function(){
    var bgmove = cc.moveBy(this.moveTime, cc.p(-this.moveSpeed, 0)).easing(cc.easeCubicActionOut());
    return bgmove;
},

// called every frame, uncomment this function to activate update callback
// update: function (dt) {

// },

});

会报错:this.bgSprite1.getPositionX();不是函数,求大神解释一下

用this.bgSprite1.position.x

会报错:TypeError: this.bgsprite1 is null 晕了

先绑定节点才行

节点绑定不是在这里绑定?我新人,怎么使用代码绑定?

。。。是不是S要大写的问题

bgSprite1:你这个BackGround1是个什么东西?