preOpenCard inside behaviors, does it works?

DunbarX at aol.com DunbarX at aol.com
Tue Jun 22 14:32:09 CDT 2010


Are you sure you have this set up correctly? A behavior is a property of an 
object, and explicitly references a button. This button has a script that 
the object "shares".

Does the button itself have the preOpenCard handler? Does the stack (or 
card) have its behavior set to the long ID of the button? If so, when the stack 
opens, the "preOpenCard" message will be sent to the button, and handled 
there.

Note that stack and card inspectors do not seem to have a place to set the 
behavior, unlike buttons and fields. These have to be set (I think, anyway) 
by a script or at least a message box command.

So if you have a stack that has its behavior set to the long ID of a button 
in that stack (or actually anywhere in memory), and a preOpenCard handler 
in the button that says "beep 3", you will get beeps every time you open the 
stack.

Craig Newman



More information about the use-livecode mailing list