The sprite onComplete call back isn’t removing the event listener. Is this creating a memory leak? Can I even remove the event listener while in the middle of it processing?
local function removeExplosion(event)
-- print(event.phase)
if event.phase == "end" then
-- print ("end explosiion")
event.target:removeSelf()
event.target = nil
end
return true
end
local function newExplosion(x,y)
local boomInstance
boomInstance = sprite.newSprite(boomSpriteSet)
boomInstance:prepare("boom")
boomInstance.x = x
boomInstance.y = y
boomInstance:addEventListener( "sprite", removeExplosion )
boomInstance:play()
end
Thanks
Rob
[import]uid: 19626 topic_id: 9633 reply_id: 309633[/import]