I start with
local background = display.newImage(“myscreen.png”)
menuScreen:insert( background )
and later, when I no longer need or want that backgroup, I use:
menuScreen:remove(background)
So far so good.
Now I’m adding in the instruction pages. In the initial event that calls the first instruction page I do:
menuScreen:remove(background)
tutorialPage1 = display.newImage("tutorialPage1.png")
tutorialScreen:insert(tutorialPage1)
and add an event listener for page turns. One possibility in the event listener is that the user wants to go back to the main screen. My code sorta looks like this:
tutorialScreen:remove(tutorialPage1)
if(user wants to go back to main screen) then
Runtime:removeEventListener( "touch", tutorialTouch );
menuScreen:insert( background )
gotoMainMenu(event)
end
The problem is that the image described by “tutorialPage1” never goes away, and “background” never appears.
How come?
Thanks,
Sean.
[import]uid: 4993 topic_id: 578 reply_id: 300578[/import]
