Make Container not show onLoad

Discuss problems and solutions.
Post Reply
electrofux
Regular
Posts: 294
Joined: 24 Jan 2012 18:22

Make Container not show onLoad

Post 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?
Softcore
Regular
Posts: 1613
Joined: 04 Nov 2012 08:34

Re: Make Container not show onLoad

Post 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?
electrofux
Regular
Posts: 294
Joined: 24 Jan 2012 18:22

Re: Make Container not show onLoad

Post 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.
dsorlien
Newbie
Posts: 39
Joined: 16 Jan 2012 04:28

Re: Make Container not show onLoad

Post 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
electrofux
Regular
Posts: 294
Joined: 24 Jan 2012 18:22

Re: Make Container not show onLoad

Post by electrofux »

Thx for the info.
Post Reply