Script Only Stack Architecture
ambassador at fourthworld.com
Wed Mar 30 19:43:58 EDT 2016
I recently wrote:
> NOTE: a long-standing source of confusion and frustration with behaviors
> is that the object holding the behavior script must be in memory when
> any stack containing objects subscribed to it is loaded.
> When behaviors are in the same stack file the engine figures it out on
> its own. But if the behaviors are in a separate stack file (regardless
> of whether it's script-only or normal) that separate stack file must be
> in memory first.
> In some cases this can mean introducing a new stack only for the purpose
> of loading your others so that they load in an order that will allow
> behaviors to be resolved correctly.
> Another option is to write a script that works on preOpenStack and walks
> through each object setting the object's behavior property to the
> object's behavior property, which forces resolution of the information
> already known to the engine but not loaded in the finicky order it requires.
> A request to simplify this has been submitted:
I forgot to mention an even simpler way to make external stack files
available, provided the first stack being loaded is a normal stack file
(as opposed to script-only, which has no properties other than a script):
Just use the stackFiles property, adding any external stacks you like.
Apparently the stackfiles entries are loaded at the same time the stack
containing those entries is loaded, and since they use relative paths
they're fairly simple to work with.
Fourth World Systems
Software Design and Development for the Desktop, Mobile, and the Web
Ambassador at FourthWorld.com http://www.FourthWorld.com
More information about the Use-livecode