Troubleshooting

Make Container not show onLoad

Started by electrofux on .

Sign in or create an account to join the conversation.

5 posts

Topic starter
I am finnishing off my template and am running into a problem with a couple of containers that i want to hide when the template is loaded. I have tried several solutions but it always comes up.

I tried an Onload script globally and in the Container interface with show (Container2,0); but it still shows up. I also tried to set the button that will hide the container when pressed to 1 but that didn't work either. In the manual therei is some info on certain circumstances where the onlad doesn't work. Any easy fix for that?
I tried replacing a large number of onLoad scripts with a single large onLoad script, but at first it did not work. I think the problem was due to the way the objects are instantiated as the template was loading. If the onLoad script was not inside the object it was manipulating, often the script did not work. My workaround was to use an expression and an onFrame script, to trigger execution of some startup code after a brief pause after the template loads:

Create expression:
startuptimer = 10

Create a new script, set execution to onFrame:
startuptimer = clamp(startuptimer - 1, 0, 10);
if(startuptimer != 1) return;
// put your onload code below
// it will execute once and only once after the template loads