I have added a cartoon balloon with words into my menu.lua, but when the scene is changed the bubble is still open. How would I properly distroy this balloon within director class?
[code]
– Modules –
local balloons = require(“Balloons”)
– A diary –
local Thoughts = {}
– Fire the event when? –
local Delay = 0
local dw = display.contentWidth
local dh = display.contentHeight
for _, thought in ipairs{
{ x = 60, y = dh - 190, text = “Quiz a friend!”, name = “first” }
} do
if type(thought) == “string” then
timer.performWithDelay(Delay, function()
Thoughts[thought]:removeSelf()
Thoughts[thought] = nil
end)
Delay = Delay + 50
else
timer.performWithDelay(Delay, function()
local balloon = balloons.Thought(display.getCurrentStage(), thought.x, thought.y, thought.text, math.random(3, 5))
if thought.name then
Thoughts[thought.name] = balloon
end
end)
Delay = Delay + 2500
end
[/code] [import]uid: 88495 topic_id: 34467 reply_id: 334467[/import]