Black screen for a short duration when switching scenes

I’m having a problem with a black screen appearing for a short duration while I switch scenes. The way I switch scenes is generally to launch the new level, then launch the hud, and then stop the current scene. It does make sense that the game hasn’t been able to preload and render the new scene before the old scene is stopped. So I tried to wait for an event on the new scene before stopping the old scene. I tried the ready event, postupdate and postrender event, but all of them seem to fire to early.

I made a simple example to show my problem. https://codepen.io/orjandh/pen/RwpBJZZ

Is the event firing to early or is there something I do not understand here? Or maybe there are other ways to prevent this black screen?

Maybe use the ‘create’ event. Or ‘preload’ it in an other scene. Or don’t preload (everything), and load in create.

Create event was one of the few I didn’t try out, because I didn’t feel like it made any sense to use that over the others. But it worked like a charm, thanks!