Strange error for event handler on overlay

I kept getting the following error

?:0: attempt to call method ‘setTextColor’ (a nil value)

when I tried to do a change scene when click on a button residing on a overlay.

storyboard.gotoScene(“menu”, “fade”, 250)

My codes do not have any setTextColor function. Seems like an internal error somewhere? [import]uid: 70056 topic_id: 34887 reply_id: 334887[/import]

It seems to me that you may be overwriting either display.newText or display.newEmbossedText, perhaps from some external library. The setTextColor() method belongs to one of those two functions and the widget library is likely using them. I know there are some older libraries that redefined display.newText and such to try and add Retina support before Corona formally added it.

[import]uid: 199310 topic_id: 34887 reply_id: 138665[/import]

Another good possibility is that the app is trying to execute the button press when the button is destroyed. May need some safeguards in the code to make sure the overlay is closed first? [import]uid: 41884 topic_id: 34887 reply_id: 138670[/import]

Hi Rob,

Not using an external library.

Hi Richard,

It works only if I hide the overlay first before exiting the scene. And strangely I also need to add a short transition to the hide overlay to make it work. Making it close immediately will result in the same error reported earlier.

Thanks.

[import]uid: 70056 topic_id: 34887 reply_id: 138686[/import]

Can you make a small sample project that demonstrates this and file a bug report with the “Report a Bug” link at the top?
[import]uid: 199310 topic_id: 34887 reply_id: 138689[/import]

Not *completely* up to date on overlay, but last time I looked at it you did have to manually hide it before leaving scenes. So that part makes sense. The transition requirement sounds much more like a bug though so definitely submit a bug report. I think storyboard issues are pretty high on the fix list.

(Just a guess, but this could be related to the bug from the other thread where exitScene was not firing in the correct order…possibly the overlay is not getting killed at the right time and the scene transition is causing things to blow up) [import]uid: 41884 topic_id: 34887 reply_id: 138691[/import]

It seems to me that you may be overwriting either display.newText or display.newEmbossedText, perhaps from some external library. The setTextColor() method belongs to one of those two functions and the widget library is likely using them. I know there are some older libraries that redefined display.newText and such to try and add Retina support before Corona formally added it.

[import]uid: 199310 topic_id: 34887 reply_id: 138665[/import]

Another good possibility is that the app is trying to execute the button press when the button is destroyed. May need some safeguards in the code to make sure the overlay is closed first? [import]uid: 41884 topic_id: 34887 reply_id: 138670[/import]

Hi Rob,

Not using an external library.

Hi Richard,

It works only if I hide the overlay first before exiting the scene. And strangely I also need to add a short transition to the hide overlay to make it work. Making it close immediately will result in the same error reported earlier.

Thanks.

[import]uid: 70056 topic_id: 34887 reply_id: 138686[/import]

Can you make a small sample project that demonstrates this and file a bug report with the “Report a Bug” link at the top?
[import]uid: 199310 topic_id: 34887 reply_id: 138689[/import]

Not *completely* up to date on overlay, but last time I looked at it you did have to manually hide it before leaving scenes. So that part makes sense. The transition requirement sounds much more like a bug though so definitely submit a bug report. I think storyboard issues are pretty high on the fix list.

(Just a guess, but this could be related to the bug from the other thread where exitScene was not firing in the correct order…possibly the overlay is not getting killed at the right time and the scene transition is causing things to blow up) [import]uid: 41884 topic_id: 34887 reply_id: 138691[/import]