This code
i can’t remove image after touch function backTitle
thanks
[lua]local function backTitle()
storyboard.gotoScene( “menu”, “fade”, 500 )
randomCharecter:removeSelf()
checkTrue = true
return true
end
function scene:createScene( event )
local group = self.view
local backBtn = display.newImage( “picMain/btn_menu.png” )
backBtn.x = display.contentWidth /2 + 280
backBtn.name = “backButton”
local function listener(event)
if event.target.name == “backButton” then
storyboard.gotoScene( “menu”, “fade”, 500 )
storyboard.removeScene( “GameFind”)
end
end
backBtn:addEventListener( “touch” , listener )
group:insert( backBtn )
end
local function randomCharecter ()
math.randomseed( os.time() )
local imageToDisplay = “picGame/find/Charecter” … math.random(4) … “.png”
local randomCharecter = display.newImageRect(imageToDisplay, 100, 200)
randomCharecter.x = display.contentWidth*0.5
randomCharecter.y = display.contentHeight - 200
end
local function removeCharecter ()
if checkTrue == true then
local randomCharecter = stage[1]
randomCharecter:removeSelf()
randomCharecter = nil
end
end
end
randomCharecter ()
removeCharecter ()[/lua] [import]uid: 169163 topic_id: 29649 reply_id: 329649[/import]