So when an object is deleted and there is only one, everything works fine. However, when multiple are deleted, everything goes wrong.
[lua]local function note(index)
local note = display.newImage(“quarter.png”)
function noteDelete()
note:removeSelf()
end
note:scale(".5",".5")
if notes[index].rot == true then
note:rotate(“180”)
end
note.x=“750”
note.y= notes[index].posy
freq1 = notes[index].freq
top1 = notes[index].top
function check(event)
f = r:getTunerFrequency()
txt.text = f
if f < freq1 + 20 and f > freq1 - 20 or f < top1 + 20 and f > top1 - 20 then
print(“hit”)
noteDelete()
end
return true
end
Runtime:addEventListener(“enterFrame”, check)
local function move()
note.x = note.x - 4
end
timer.performWithDelay(20, move, -1)
return note
end[/lua]
How can I make it so there all the notes do not freeze and lots of errors appear? I have all the note in a table. Is there any way I could pass in the note table index and somehow delete that one? Or is there an easy fix. Thanks! [import]uid: 59735 topic_id: 20419 reply_id: 320419[/import]