Composer showOverlay not being sent a parent?

I’m using composer to show an overlay like so

 

composer.showOverlay("scenes.levelup", { isModal = true, params = { getLevel = storeTable.level } })

When I print out the event table inside the overlay I get the following 

table: { [sceneName] =\> "scenes.levelup" [name] =\> "create" [params] =\> table: 0x7faa389d94e0 { [getLevel] =\> 2 } }

For some reason I can’t get it to send the parent. I need the event.parent to call a function on close. 

Hi @dmglakewood,

Did you follow the code example shown here, under “Accessing the Parent Scene”?

http://docs.coronalabs.com/daily/guide/system/composer/index.html#overlays

Brent

Yeah I’ve followed that like 10 times. I have it working just fine else where in my app and even using the same code it doesn’t ever send the parent for some reason.

I don’t think it’s a bug with corona because it does work elsewhere but my code is so simple I don’t see where the issue could be.

Strange… I guess I’d look for some instance of a duplicated variable name or something? Or more likely a scoping issue?

Brent

I figured it out…I guess the parent doesn’t get passed to the create or the destroy functions. If I call it in the scene:hide function then the reference is there. I guess I just assumed it would be passed to all the functions.

Hi @dmglakewood,

Did you follow the code example shown here, under “Accessing the Parent Scene”?

http://docs.coronalabs.com/daily/guide/system/composer/index.html#overlays

Brent

Yeah I’ve followed that like 10 times. I have it working just fine else where in my app and even using the same code it doesn’t ever send the parent for some reason.

I don’t think it’s a bug with corona because it does work elsewhere but my code is so simple I don’t see where the issue could be.

Strange… I guess I’d look for some instance of a duplicated variable name or something? Or more likely a scoping issue?

Brent

I figured it out…I guess the parent doesn’t get passed to the create or the destroy functions. If I call it in the scene:hide function then the reference is there. I guess I just assumed it would be passed to all the functions.