I’m sure this is the completely wrong way to go about this, but I can pass the parent scene in the parameters to the overlay, modify a variable in the overlay tied to the scene that was passed and then close the overlay and it will show up in the parent scene:
--------parent scene --------------
local storyboard = require("storyboard")
local scene = storyboard.newScene()
local function openOverlay()
local options = {
params = { parent\_scene = scene }
}
storyboard.showOverlay("myoverlay", options)
end
function scene:createScene(event)
end
--other functions
function scene:overlayEnded(event)
print(self.my\_new\_var) end
------other parent scene code here to make scene show-----
-----------------------------------------
--------------Overlay scene snippet----------------
local storyboard = require("storyboard")
local scene = storyboard.newScene()
local parent\_scene = nil
local function closeOverlay()
parent\_scene.my\_new\_var = "TESTING"
storyboard.hideOverlay()
return true
end
function scene:createScene(event)
local group = self.view
parent\_scene = event.params.parent\_scene
----extra stuff below
end
return scene
-------------------end overlay snippet-----------
Thoughts on this approach? Sounds highly wrong as it would be passing the whole scene object to the overlay. That screams memory problems. Any better ways to accomplish this?
[import]uid: 92150 topic_id: 30229 reply_id: 121097[/import]