@ar2rsawseen I am using GiderosCodingEasy from
https://github.com/ar2rsawseen/GiderosCodingEasyWhen call:
local sound_gem_0 = Sound.new("sounds/gem-0.mp3")
sound_gem_0:play() |
It throws an error:
.\GiderosCodingEasy.lua:1128: table index is nil
stack traceback:
.\GiderosCodingEasy.lua:1128: in function <.\GiderosCodingEasy.lua:1126> |
If I change from self to channel it works:
function Sound:play()
local channel = self:_play()
if channel ~= nil then
channel.isPlaying = true
channel:addEventListener(Event.COMPLETE, function(channel)
self.isPlaying = false
application.sounds[self.id] = nil --- Line 1128
end, channel)
if application.sounds == nil then
application.sounds = {}
application.currentSound = 1
end
channel.id = application.currentSound
application.sounds[channel.id] = channel
application.currentSound = application.currentSound + 1
--setting global volume
channel:setVolume(application:getVolume())
end
return channel
end |
So could you look at this and correct the problem?
Comments
Attaching project here for now, till github is back
No need Event.COMPLETE anymore ? :P
Likes: vitalitymobile