BUG with Storyboard when using gotoScene

Hi ALL,

I have been debugging this for days. Appreciate your responses.

I have been unable to getback to my main menu lua file from my game file. I have tried
everything possible. On the terminal I get the following exception. I noticed on another
thread that Corona accepted that this was a bug back in April. Has this been fixed? Please
let me know if there are any workarounds. Thanks.

[code]

Runtime error
?:0: attempt to index field ‘contentBounds’ (a nil value)
stack traceback:
[C]: ?
?: in function ‘?’
?: in function ‘gotoScene’
/Users/Rahul/Documents/RahulGame/level1.lua:58: in function ‘onRelease’
?: in function <?:200>
?: in function <?:229>

[import]uid: 175550 topic_id: 31524 reply_id: 331524[/import]

As a tip only remember that the API [lua]contentBounds[/lua] is read-only so you cannot try to assign anything to it.

API: http://docs.coronalabs.com/api/type/DisplayObject/contentBounds.html
Sorry not being so helpful but I thought I could notice you though.

Cheers,
Rodrigo. [import]uid: 89165 topic_id: 31524 reply_id: 125966[/import]

All I am doing is a storyboard.gotoScene (“menu”). This is the statement causing the contentBounds exception. Any clues. Here is the link of other people who ran into this problem. http://developer.coronalabs.com/forum/2012/04/12/cannot-gotoscene-after-reloading-current-scene [import]uid: 175550 topic_id: 31524 reply_id: 125968[/import]

I had a similar problem this day.

My storyboard.gotoScene did not work after upgrading to the latest build.

As I have no time to make any test, i changed my code.

WAS :

options = {effect = "slideLeft", speed = 500 }  
storyboard.gotoScene("myScene", options)  

BECAME :

storyboard.gotoScene("myScene", "SlideLeft", 500)  

and it works.

I do not explain that.

Hope this help. [import]uid: 5578 topic_id: 31524 reply_id: 126002[/import]

Are you sure your removing any runtime listeners that may be accessing a contents bounds property in your exitScene event? [import]uid: 84637 topic_id: 31524 reply_id: 126016[/import]

As a tip only remember that the API [lua]contentBounds[/lua] is read-only so you cannot try to assign anything to it.

API: http://docs.coronalabs.com/api/type/DisplayObject/contentBounds.html
Sorry not being so helpful but I thought I could notice you though.

Cheers,
Rodrigo. [import]uid: 89165 topic_id: 31524 reply_id: 125966[/import]

All I am doing is a storyboard.gotoScene (“menu”). This is the statement causing the contentBounds exception. Any clues. Here is the link of other people who ran into this problem. http://developer.coronalabs.com/forum/2012/04/12/cannot-gotoscene-after-reloading-current-scene [import]uid: 175550 topic_id: 31524 reply_id: 125968[/import]

I had a similar problem this day.

My storyboard.gotoScene did not work after upgrading to the latest build.

As I have no time to make any test, i changed my code.

WAS :

options = {effect = "slideLeft", speed = 500 }  
storyboard.gotoScene("myScene", options)  

BECAME :

storyboard.gotoScene("myScene", "SlideLeft", 500)  

and it works.

I do not explain that.

Hope this help. [import]uid: 5578 topic_id: 31524 reply_id: 126002[/import]

Are you sure your removing any runtime listeners that may be accessing a contents bounds property in your exitScene event? [import]uid: 84637 topic_id: 31524 reply_id: 126016[/import]

There was a bug where if you didn’t use a transition effect whilst changing scenes had a runtime touch listener on scene1 and scene 2 and you attempted to go from scene1 > scene 2 the runtime touch listener could get invoked for both scenes instantaneously got fired and a scene1 > scene2 > scene 1> scene2 infinite loop started to happen.

The good news is that it has been fixed.

The fix should be available (along with lots more storyboard & widget fixes) in daily build 928
Thanks for your patience. [import]uid: 84637 topic_id: 31524 reply_id: 126317[/import]

I got it to work, thanks for your help! [import]uid: 175550 topic_id: 31524 reply_id: 126323[/import]

There was a bug where if you didn’t use a transition effect whilst changing scenes had a runtime touch listener on scene1 and scene 2 and you attempted to go from scene1 > scene 2 the runtime touch listener could get invoked for both scenes instantaneously got fired and a scene1 > scene2 > scene 1> scene2 infinite loop started to happen.

The good news is that it has been fixed.

The fix should be available (along with lots more storyboard & widget fixes) in daily build 928
Thanks for your patience. [import]uid: 84637 topic_id: 31524 reply_id: 126317[/import]

I got it to work, thanks for your help! [import]uid: 175550 topic_id: 31524 reply_id: 126323[/import]

I am also having trouble with storyboard.gotoScene using the latest builds. Please advise!

Here is the simplified setup:

[lua]function pauseListener(event)
if “clicked” == event.action then
local i = event.index
if 1 == i then
–dismiss
elseif 2 == i then
storyboard.gotoScene( “scripts.levelSelect”) – this crashes!
end
end
end

function onPauseBtnRelease()
native.showAlert(“Paused”,”Test”, {“Resume”,”Level Select”},pauseListener)
–storyboard.gotoScene( “scripts.levelSelect”) --works if called here
end[/lua]

Whenever I attempt to use storyboard.gotoScene after a native.showAlert call or a storyboard.showOverlay menu, I get the following error:

Runtime error
bad argument #-2 to ‘insert’ (Proxy expected, got nil)
stack traceback:
[C]: ?
[C]: in function ‘insert’
?: in function ‘?’
?: in function ‘gotoScene’
…circleTen/circleTenRebuild/scripts/levels/level1.lua:28: in function [import]uid: 44271 topic_id: 31524 reply_id: 126555[/import]

@jonaApps.

I made up a simple sample based on your instructions and couldn’t reproduce your issue.

You can download the sample i made here to confirm: http://www.mediafire.com/?oc7jr583c7ovr70 [import]uid: 84637 topic_id: 31524 reply_id: 126567[/import]

Danny - thanks for taking a look! Your example worked fine in the project you linked to, but once I put it in my project I get the same error:

bad argument #-2 to ‘insert’ (Proxy expected, got nil)
stack traceback:
[C]: ?
[C]: in function ‘insert’
?: in function ‘?’
?: in function ‘gotoScene’

I still have no trouble calling gotoScene directly.

Any ideas why this might be? [import]uid: 44271 topic_id: 31524 reply_id: 126573[/import]

Odd.

I may have to ask for more code because I can only guess without it.

Are you trying to insert an image into a group below that call?
Is your project massive or can you condense it into something I can view as a simple sample like the one i made?

Thanks [import]uid: 84637 topic_id: 31524 reply_id: 126575[/import]

Danny,

I think I found the problem. I was calling storyboard.removeScene(storyboard.getCurrentSceneName()) within scene:exitScene( event ). Once I took that out, no more issue with gotoScene changes within a native Alert.

I’ll use another method to clean up the scene I’m leaving.

Thanks for the help.

JJ [import]uid: 44271 topic_id: 31524 reply_id: 126578[/import]

Call that in your

didExitScene function

And it should work fine :slight_smile: [import]uid: 84637 topic_id: 31524 reply_id: 126579[/import]

I am also having trouble with storyboard.gotoScene using the latest builds. Please advise!

Here is the simplified setup:

[lua]function pauseListener(event)
if “clicked” == event.action then
local i = event.index
if 1 == i then
–dismiss
elseif 2 == i then
storyboard.gotoScene( “scripts.levelSelect”) – this crashes!
end
end
end

function onPauseBtnRelease()
native.showAlert(“Paused”,”Test”, {“Resume”,”Level Select”},pauseListener)
–storyboard.gotoScene( “scripts.levelSelect”) --works if called here
end[/lua]

Whenever I attempt to use storyboard.gotoScene after a native.showAlert call or a storyboard.showOverlay menu, I get the following error:

Runtime error
bad argument #-2 to ‘insert’ (Proxy expected, got nil)
stack traceback:
[C]: ?
[C]: in function ‘insert’
?: in function ‘?’
?: in function ‘gotoScene’
…circleTen/circleTenRebuild/scripts/levels/level1.lua:28: in function [import]uid: 44271 topic_id: 31524 reply_id: 126555[/import]