Hi everyone,
I am using storyboard in my app and can’t figure out if i need to remove objects from the display group in destroy scene or exit scene. Does anyone know? Here is some code where I am wondering if I need to remove the loadingScreenOne from display group. If someone could fix the code if it needs fixing that would be greatly appreciated.
Thanks,
Chris
[lua]local storyboard = require( “storyboard” );
local scene = storyboard.newScene();
– BEGINNING OF YOUR IMPLEMENTATION
local myTimer;
local loadingImage
function scene:createScene(event)
local screenGroup = self.view;
end
function scene:enterScene(event)
local screenGroup = self.view;
loadingImage = display.newImageRect(“images/loadingScreen1.png”, 480, 320);
loadingImage.x = 240; loadingImage.y = 160;
screenGroup:insert(loadingImage);
local goToLoadingScreenTwo = function()
storyboard.gotoScene(“loadingScreenTwo”);
end
myTimer = timer.performWithDelay( 1000, goToLoadingScreenTwo, 1 );
end
function scene:exitScene()
if myTimer then
timer.cancel(myTimer);
end
end
function scene:destroyScene()
myTimer = nil;
loadingImage = nil;
end
– END OF YOUR IMPLEMENTATION
– “createScene” event is dispatched if scene’s view does not exist
scene:addEventListener( “createScene”, scene )
– “enterScene” event is dispatched whenever scene transition has finished
scene:addEventListener( “enterScene”, scene )
– “exitScene” event is dispatched before next scene’s transition begins
scene:addEventListener( “exitScene”, scene )
– “destroyScene” event is dispatched before view is unloaded, which can be
scene:addEventListener( “destroyScene”, scene )
return scene; [import]uid: 126017 topic_id: 27802 reply_id: 327802[/import]