Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
所以我有这个设置。声音有效。如果在scene:create( event ). 但是,当我从声音中的 onComplete 方法调用该函数时,该函数会触发,但是在声音停止播放后我收到此消息“尝试调用零值”。
scene:create( event )
media.playSound( quotepath, {onComplete = endGame } )
功能:
function endGame() composer.gotoScene( "scenes.gameover", "fade", 500 ) end
这应该是语法的样子,
local onComplete onComplete = function(event) print( "sound play ended" ) end media.playSound( "song1.mp3", onComplete )