passward.js 1.2 KB

123456789101112131415161718192021222324252627282930
  1. cc.Class({
  2. extends: cc.Component,
  3. properties: {
  4. editbox: cc.EditBox
  5. },
  6. onLoad () {
  7. this.password = '';
  8. },
  9. onEditDidBegan: function(editbox, customEventData) {
  10. // 这里 editbox 是一个 cc.EditBox 对象
  11. // 这里的 customEventData 参数就等于你之前设置的 "foobar"
  12. },
  13. // 假设这个回调是给 editingDidEnded 事件的
  14. onEditDidEnded: function(editbox, customEventData) {
  15. // 这里 editbox 是一个 cc.EditBox 对象
  16. // 这里的 customEventData 参数就等于你之前设置的 "foobar"
  17. },
  18. // 假设这个回调是给 textChanged 事件的
  19. onTextChanged: function(text, editbox, customEventData) {
  20. // 这里的 text 表示 修改完后的 EditBox 的文本内容
  21. // 这里 editbox 是一个 cc.EditBox 对象
  22. // 这里的 customEventData 参数就等于你之前设置的 "foobar"
  23. },
  24. // 假设这个回调是给 editingReturn 事件的
  25. onEditingReturn: function(editbox, customEventData) {
  26. // 这里 editbox 是一个 cc.EditBox 对象
  27. // 这里的 customEventData 参数就等于你之前设置的 "foobar"
  28. }
  29. });