This code keeps calling the print function even though i remove the listener.
[code]local doCollision = function()
print(“has this stopped”)
Runtime:removeEventListener(“enterFrame”, doCollision)
end
Runtime:addEventListener(“enterFrame”, doCollision)[/code]
while this code stops the print function after the first time just fine
[code]local function doCollision()
print(“has this stopped”)
Runtime:removeEventListener(“enterFrame”, doCollision)
end
Runtime:addEventListener(“enterFrame”, doCollision)[/code]
What i have been trying to figure out is how i can stop running the function with the first function. I have tried several things but i cannot seem to figure it out.
[import]uid: 39391 topic_id: 9238 reply_id: 309238[/import]
