I just have one last question, if I want to re-create the scene, for example. In the code show:
SCENE1.LUA
[lua]local storyboard = require( “storyboard” )
local scene = storyboard.newScene()
local playButton = display.newImage(“ene5.png”)
local function back ()
storyboard.gotoScene( “scene2”, “slideLeft”, 800 ) --end
local variable = 3
local function menos ()
variable = variable -1
print(variable)
end
timer.performWithDelay(1,menos, 1)
– put all scene related graphics and sound creation here if you want them created before the
– scene transitions on screen. Must be at least one thing created here.
function scene:createScene(event)
local group = self.view
playButton.x = 190
playButton.y = 260
playButton:addEventListener( “touch”, back )
group:insert(playButton) –
end
–
– Put things here that need created after the scene is on the screen, like timers, audio voice overs,
– runtime listeners, etc. Anything you create here like timers and runtime listeners must be removed
– in exitScene. For most scenes you don’t need to do anything here.
function scene:enterScene( event )
local group = self.view
end
function scene:exitScene( event )
local group = self.view
end
function scene:destroyScene( event )
local group = self.view
end
scene:addEventListener( “createScene”, scene )
scene:addEventListener( “enterScene”, scene )
scene:addEventListener( “exitScene”, scene )
scene:addEventListener( “destroyScene”, scene )
return scene[/lua]
The variable = 3, however, comes down to two by a function, if I want to scene1, the variable is still worth 2 and does not rise to 1, not if I explain. Any suggestions? [import]uid: 98258 topic_id: 34428 reply_id: 137006[/import]