Uncaught TypeError: Cannot read property ‘play’ of undefined
能具体点么这么一个错误很难看出来啊
谢谢回复哈!
CCBoot.js:689 Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user’s experience. For more help, check http://xhr.spec.whatwg.org/.
CCDebugger.js:331 Cocos2d-JS v3.7.1
MenuScene.js:7 this is 1
MenuScene.js:44 this is onEnter
MenuScene.js:10 this is 2
MenuScene.js:12 this is 3
MenuScene.js:20 this is 4
MenuScene.js:33 ==onplay clicked
src/PlayScene.js:47 this is playScence
frameworks/cocos2d-html5/CCDebugger.js:331 cocos2d: CCSpriteBatchNode: resizing TextureAtlas capacity from 71 to 96.
frameworks/cocos2d-html5/CCDebugger.js:331 cocos2d: CCSpriteBatchNode: resizing TextureAtlas capacity from 96 to 129.
frameworks/cocos2d-html5/CCDebugger.js:331 cocos2d: CCSpriteBatchNode: resizing TextureAtlas capacity from 129 to 173.
frameworks/cocos2d-html5/CCDebugger.js:331 cocos2d: CCSpriteBatchNode: resizing TextureAtlas capacity from 173 to 232.
frameworks/cocos2d-html5/CCDebugger.js:331 cocos2d: CCSpriteBatchNode: resizing TextureAtlas capacity from 71 to 96.
frameworks/cocos2d-html5/CCDebugger.js:331 cocos2d: CCSpriteBatchNode: resizing TextureAtlas capacity from 96 to 129.
frameworks/cocos2d-html5/CCDebugger.js:331 cocos2d: CCSpriteBatchNode: resizing TextureAtlas capacity from 129 to 173.
frameworks/cocos2d-html5/CCDebugger.js:331 cocos2d: CCSpriteBatchNode: resizing TextureAtlas capacity from 173 to 232.
frameworks/cocos2d-html5/cocos2d/audio/CCAudio.js:694 Uncaught TypeError: Cannot read property ‘play’ of undefined
看下network,是不是有文件加载失败了~~
还有就是音频文件是否成功加载~~
Cannot read property ‘play’ of undefined
你先用cc.log()打印调试找找是哪行涉及媒体文件的语句出错了,然后看看是不是对应的变量名错了,比如XX.play,那个XX不是你定义的名字,或者如果是在被封装的位置,看看参数传递有没有问题。
应该是事件里面用了this。指向错误
该主题在最后一个回复创建后14天后自动关闭。不再允许新的回复。