Need help with using Overlay screens

Hi All,

          I call a pop-up screen with 

storyboard.showOverlay(“scrClues”, options2) – called by object listener)

The overlay screen works well as intended.

When the user exits the overlayscreen using   storyboard.hideOverlay(),

the control comes back to the previous screen but nothing happens.

I need to take some actions based on the “user selection” in the overlay screen. I am using a persistent variable to check this, The problem is when the control returns to the “calling” screen, nothing happens. 

I have “print” statements on createScene, enterScene etc. but nothing shows up until some user action happens.

how do I execute a piece of code on return from the overlay screen?

I am trying to use the showOverlay in place of gotoScene because I want to preserve the changes made to the screen, instead of having to redo it on return.

Thanks

You need to add an event listener to your storyboard scene that you are returning to called hideOverlay.  And then the function handler for that will fire when the hideOverlay occurs and you can do trigger code in that function.

function scene:overlayEnded( event )     local group = self.view       -- do your trigger stuff here end   scene:addEventListener( "overlayEnded", scene )

Be aware that hiding the overlay doesn’t support transitions nor can you pass parameters back using the options table.  But it sounds like you’re not doing that anyway.

Thanks Rob. It is working now.

You need to add an event listener to your storyboard scene that you are returning to called hideOverlay.  And then the function handler for that will fire when the hideOverlay occurs and you can do trigger code in that function.

function scene:overlayEnded( event )     local group = self.view       -- do your trigger stuff here end   scene:addEventListener( "overlayEnded", scene )

Be aware that hiding the overlay doesn’t support transitions nor can you pass parameters back using the options table.  But it sounds like you’re not doing that anyway.

Thanks Rob. It is working now.