TextBox Implementation

TextBox Implementation
0

Hi there! I am just learning cocos2d js. I want to implement an Editbox. I used sample text found at EditBox component reference but returns an error;

1 - Edit Box is not defined
2 - Can not read ‘Node’ of undefined.

Any one who can help me please? I will be really grateful. Thanks in advance.

Here’s the code;

var editboxEventHandler = new cc.Component.EventHandler();
editboxEventHandler.target = cc.Node_Settings; //this.node;
editboxEventHandler.component = “cc.txtBUser_Name”;
editboxEventHandler.handler = “onEditDidBegan”;
editboxEventHandler.customEventData = “foobar”;
editbox.editingDidBegan.push(editboxEventHandler);

// here is your component file
cc.Class({

name: 'cc.txtBUser_Name',

extends: cc.Component,

properties: {    

    Node_Settings: {

        default: null,

        type: cc.Node

    },

},

onEditDidBegan: function(editbox, customEventData) {       },
// Suppose this callback is for the editingDidEnded event.
onEditDidEnded: function(editbox, customEventData) {    },
// Suppose this callback is for the textChanged event.
onTextChanged: function(text, editbox, customEventData) { 
},
// Suppose this callback is for the editingReturn event.
onEditingReturn: function(editbox,  customEventData) {    },

// update (dt) {},

});