every time i go to another scene the animation gone but when i comeback to the scene, the animation not start from the begining. how to stop the sprite animation everytime i goto another scene,then when i comeback the animation restart again from the 1st frame. It is only two frames in my imagesheets.
Thanks in advance.
here is my code
function scene:create( event )
local sceneGroup = self.view
image = display.newImage( “betul.png” )
image.x = display.contentCenterX
image.y = display.contentCenterY
sceneGroup:insert( image )
image.touch = onSceneTouch
------------------------
-----------------------
image2 = display.newImage( “fikir.gif” )
image2.x = display.contentCenterX
image2.y = display.contentCenterY
image2.isVisible=true
sceneGroup:insert( image2 )
– an image sheet with a character
local sheet1 = graphics.newImageSheet( “betul10.gif”, { width=400, height=470, numFrames=2 } )
– play 8 frames every 1000 ms
local instance1 = display.newSprite( sheet1, { name=“character”, start=1, count=2, time=5999 } )
instance1.x = display.contentWidth / 4 + 40
instance1.y = 75
instance1.xScale = .5
instance1.yScale = .5
instance1:play()
sceneGroup:insert( instance1 )