I’m using Monarch. A gui script in one of the screens create a map. This is heavy, so I only want it to be done once. It seems that every time a screen is shown, all the scripts are reloaded (including go.property() properties outside the file scope). This seems odd.
It means I can’t check whether the map has been created, so it’s created every time Monarch shows the screen. I’m sure I’m missing something, but what?
The idea behind Monarch is that screens are located in collections and loaded/created via collection proxies or factories. When a screen is hidden it is usually unloaded/deleted. If you don’t want it to be unloaded you check the Preloaded flag on the script.
I knew there was something simple I’d missed. Brilliant, I only need this on this one screen, so it’s great I have this flexibility to pick and choose per screen.