I created an animation with images transition with Corona SDK version 2018.3280, it works fine when the application starts, but when I open a new scene and return to the scene where the animation is, it goes crazy.
Video: https://www.youtube.com/watch?v=1U8rtMsGGEY
home.lua
local img local img2 img = display.newImageRect(sceneGroup,"images/2016.jpg",display.contentWidth, imgX) img.anchorX = 0 img.anchorY = 0 img.y = navBar.y + navBar.height img2 = display.newImageRect(sceneGroup,"images/2016-2.jpg",display.contentWidth, imgX) img2.anchorX = 0 img2.anchorY = 0 img2.y = navBar.y + navBar.height img2.x = img.x + img.width function scene:show( event ) local sceneGroup = self.view local phase = event.phase time = timer.performWithDelay(2000, anim1) function anim1() trans1 = transition.to(img,{time= 1500,x = -display.contentWidth}) trans2 = transition.to(img2,{time= 1500,x = 0}) time1 = timer.performWithDelay(2000,anim2) end function anim2() time2 = timer.performWithDelay(2000,anim3) img.x = display.contentWidth end function anim3() trans3 = transition.to(img2,{time= 1500,x = -display.contentWidth}) trans4 = transition.to(img,{time= 1500,x = 0,onComplete = anim4}) end function anim4() img2.x = display.contentWidth time3 = timer.performWithDelay(2000,anim1) end if ( phase == "will" ) then elseif ( phase == "did" ) then end end function scene:hide( event ) local sceneGroup = self.view local phase = event.phase if ( phase == "will" ) then elseif ( phase == "did" ) then timer.cancel(time) --timer.cancel(time1) --timer.cancel(time2) --timer.cancel(time3) transition.cancel(trans1) transition.cancel(trans2) transition.cancel(trans3) transition.cancel(trans4) composer.removeHidden() end end
How can I solve this?