You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the LiveCode engine loads a stack file with a behavior property it immediately tries to resolve it. If it can't resolve it then the behavior silently fails to load and an app won't function as intended.
Example scenario where the behavior will not be associated with the stack:
Stack A is a behavior script.
Stack B has Stack A assigned to it as a behavior.
You load Stack B into memory and Stack A is not assigned to the stackFiles property of Stack B (or any other stack already in memory).
You load Stack A into memory.
When Stack B opens Stack A is not available and cannot be found by the engine. Thus the behavior assignment fails and your code doesn't work as expected.
Levure currently loads all behaviors into memory and then dispatches a LoadBehavior message to each one. Originally this allowed a script only stack to assign a parent behavior and to ensure that a parent behavior was in memory. Now that LiveCode supports with behavior when defining a script only stack it isn't necessary.
By assigning each behavior stack file to the stackFiles property of the app stack all behaviors will resolve properly when the engine first requests them. The LoadBehavior message can be removed and Levure can rely on engine features in order to provide a development experience that doesn't leave the developer scratching their head as to why something doesn't work because a behavior silently failed to load in the background.
The text was updated successfully, but these errors were encountered:
When the LiveCode engine loads a stack file with a
behavior
property it immediately tries to resolve it. If it can't resolve it then the behavior silently fails to load and an app won't function as intended.Example scenario where the behavior will not be associated with the stack:
When Stack B opens Stack A is not available and cannot be found by the engine. Thus the behavior assignment fails and your code doesn't work as expected.
Levure currently loads all behaviors into memory and then dispatches a
LoadBehavior
message to each one. Originally this allowed a script only stack to assign a parent behavior and to ensure that a parent behavior was in memory. Now that LiveCode supportswith behavior
when defining a script only stack it isn't necessary.By assigning each behavior stack file to the
stackFiles
property of theapp
stack all behaviors will resolve properly when the engine first requests them. TheLoadBehavior
message can be removed and Levure can rely on engine features in order to provide a development experience that doesn't leave the developer scratching their head as to why something doesn't work because a behavior silently failed to load in the background.The text was updated successfully, but these errors were encountered: