Skip to content
Trevor DeVore edited this page Mar 12, 2017 · 8 revisions

The behaviors folder sits alongside the app.yml file in your application folder. It holds script-only stack files that will be opened on application startup so they are loaded in memory and available globally for use as behaviors.

After a behavior stack is loaded into memory the LoadBehavior message is dispatched to it. This enables a script-only stack to set its own behavior which makes it possible to chain behaviors.

Behaviors can be loaded individually or in bulk. You specify which behaviors to load in app.yml. If you specify a folder then every file in that folder and any subfolders should be a script-only LiveCode stack. The folder will load recursively so any subfolders will be loaded as well.

Update behaviors section in app.yml

Whenever you add or remove behavior stacks be sure to update the behaviors section of app.yml. This enables the framework to properly load your behavior stacks at startup.

# app.yml
...
behaviors:
  1:
    filename: [relative path to stack file within behaviors folder]
    encrypt: Optional parameter that can override the `encrypt stacks` setting for this stack.
  2:
    folder: [relative path a folder with behavior stack files]
    encrypt: Optional parameter that can override the `encrypt stacks` setting for all stacks in the folder.
  ...
...

Examples

behaviors:
  1:
    filename: ./behaviors/my_unencrypted_behavior.livecodescript
    encrypt: false
  2:
    folder: ./behaviors

Clone this wiki locally