before vs on in behavior scripts - red herring alert!

J. Landman Gay jacque at hyperactivesw.com
Thu Mar 20 12:00:47 EDT 2014


On 3/20/14, 10:09 AM, Devin Asay wrote:
> So it appears that each time I launch the project I have to reassign
> the behavior to the buttons. This only seems to happen for behaviors
> stored in library stacks. I have seen a similar problem with objects
> that were assigned a background pattern stored in a library stack. In
> that instance I finally had to add a line of code in my preOpenStack
> handler to reassign the bg pattern.

My guess is: the engine looks for behaviors and other resources when the 
main stack first opens (before any messages are sent,) then it gets the 
command to open the libraries, and by the time that happens the main 
stack has already finished looking for all resources.

If my theory is right, you wouldn't see the problem if you were using a 
launch stack that loads the libraries and then opens the main working 
stack. The libraries would be in RAM already in that scenario.

Maybe the engine could change the order so that it doesn't look for 
resources until after preOpenStack is sent, but I'm not sure what the 
internal repercussions of that would be. Might be worth a feature 
request though.

-- 
Jacqueline Landman Gay         |     jacque at hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com




More information about the use-livecode mailing list