Hello,
I’m quite new in corona sdk. I’m doing some test using parts of code from Tiny Penguin. If you are familiar with this demo, it has a method called createHill(). The first time I executed it works fine, but after it finishes the “lap” I want to execute the next want where I remove all and creates again.
The problem is in “onRectEnterFrame” where raises a nil exception in rect:localToContent. It is quite estrange because after hours of debugging all parameter of rect are fine, but just localToContent is nil.
This is the part of code where I have the issue:
local onRectEnterFrame
onRectEnterFrame = function(event)
local rectContentCoordX, notNeeded = rect:localToContent(rect.xPos,0)
if(rectContentCoordX \< 0) then
Runtime:removeEventListener("enterFrame", onRectEnterFrame)
for key,body in pairs(objects) do
body:removeSelf()
end
createHill()
end
end
When I want to go to the next level I just remove all eventListeners and create all again.
If you need more info or code, please let me know. I’m stuck in here.
Thanks in advance! [import]uid: 48295 topic_id: 16099 reply_id: 316099[/import]