Hi, I am creating an animated widget button. When I press the widget button it will show the animated button. When I release the widget it will direct me to another scene.
Problem:
When I release the button and it directs me to another scene the button - animated sprite Visibility is shown in the new scene. I want the button-animated sprite to disappear when it changes to another scene.
For the animated button I use sprite animation.
local button1Press = function( event ) --show animation when is pressed local buttonBye2 = graphics.newImageSheet( "images/button\_animation\_small.png", { width=108, height=108, numFrames=20, border = 0 } ) -- play 8 frames every 1000 ms --this bye\_Animation object is not local local bye\_Animation = display.newSprite( buttonBye2, { name="play", start=11, count=20, time=1500, loopCount = 1 } ) --properties of the button. The size and the position. bye\_Animation.x = 250; bye\_Animation.y = 400 bye\_Animation:play() screenGroup:insert(button1Press) return true end
For directing me to another scene after the button is release I use storyboard.
local function button1Release( event ) if event.phase == "ended" then storyboard.gotoScene( "scene1", "fade", 800 ) return true end
I attached my code file. Thank you for your time.