| 123456789101112131415161718192021222324252627282930 |
- cc.Class({
- extends: cc.Component,
- properties: {
- editbox: cc.EditBox
- },
- onLoad () {
- this.password = '';
- },
- onEditDidBegan: function(editbox, customEventData) {
- // 这里 editbox 是一个 cc.EditBox 对象
- // 这里的 customEventData 参数就等于你之前设置的 "foobar"
- },
- // 假设这个回调是给 editingDidEnded 事件的
- onEditDidEnded: function(editbox, customEventData) {
- // 这里 editbox 是一个 cc.EditBox 对象
- // 这里的 customEventData 参数就等于你之前设置的 "foobar"
- },
- // 假设这个回调是给 textChanged 事件的
- onTextChanged: function(text, editbox, customEventData) {
- // 这里的 text 表示 修改完后的 EditBox 的文本内容
- // 这里 editbox 是一个 cc.EditBox 对象
- // 这里的 customEventData 参数就等于你之前设置的 "foobar"
- },
- // 假设这个回调是给 editingReturn 事件的
- onEditingReturn: function(editbox, customEventData) {
- // 这里 editbox 是一个 cc.EditBox 对象
- // 这里的 customEventData 参数就等于你之前设置的 "foobar"
- }
- });
|