Hello,
When leaving a scene, for witch there are an enterFrame listener object attached to an object, to an other scene, the Runtime continue to run, but stop when I come back, why ??
I explain :
–scene1–
local scene1 = composer.newScene() function scene1:create(event) local view=self.view local rect=display.newRect(view,0,0,300,300) rect:addEventListener("tap",function() composer.gotoScene("scene2") end) end scene1:addEventListener( "create", scene1 )
–scene2–
local scene2 = composer.newScene() function scene2:create(event) local view=self.view local rect=display.newRect(view,0,0,300,300) rect:addEventListener("tap",function() composer.gotoScene("scene1") end) local circ=display.newCircle(view,100,100,30) circ.enterFrame=function() circ.y=circ.y+1 end Runtime:addEventListener("enterFrame",circ) end scene2:addEventListener( "create", scene2)
So i arrive on scene1, then i click on the rectangle to go on scene2.
On scene 2 the circle began to move from top to bottom of the device, but when I switch to scene 1 , I know that the circle continue to drop, and when i re-enter on scene2, the Runtime stop to work !
I have tried this with a runtime working with a function, and there are no problem, but not with a table proxy.
Thanks, Yvan.