ButtonStop.js 761 B

12345678910111213141516171819202122232425262728293031
  1. cc.Class({
  2. extends: cc.Component,
  3. properties: {
  4. button: cc.Button,
  5. },
  6. // 存储数据:cc.sys.localStorage.setItem(“key”,”value”)
  7. // 获取数据:cc.sys.localStorage.getItem(“key”)
  8. // 移除数据:cc.sys.localStorage.removeItem(“key”)
  9. // 清除所有:cc.sys.localStorage.clear()
  10. // use this for initialization
  11. //cc.director.pause()
  12. //cc.director.resume()
  13. onLoad: function () {
  14. this.button.node.on('click', this.callback, this);
  15. },
  16. // called every frame
  17. update: function (dt) {
  18. },
  19. callback: function (event) {
  20. Audio.playeffect('resources/audio/sound_click.mp3');
  21. cc.director.pause();
  22. cc.find('Canvas/Tip').active = true;
  23. }
  24. });