Page 1 of 1

Make Container not show onLoad

Posted: 08 Apr 2013 13:53
by electrofux
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?

Re: Make Container not show onLoad

Posted: 08 Apr 2013 15:18
by Softcore
I had some similar problems with one of my templates...no matter what I did, it kept showing up....

It turned though to be a case of a forgotten script somewhere that between the ifs and the results, it was causing to container to show. Are you sure thats not the case with your template?

Re: Make Container not show onLoad

Posted: 08 Apr 2013 15:21
by electrofux
I am 1 object away from 100% Lemur Memory :shock: -so no i am not sure ;-) But it is a pretty isolated part of the whole thing.

Re: Make Container not show onLoad

Posted: 13 Apr 2013 01:52
by dsorlien
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

Re: Make Container not show onLoad

Posted: 16 Apr 2013 09:17
by electrofux
Thx for the info.