I’m not sure you can really represent behaviors cleanly like that. They don’t sit where they are drawn completely. In addition to catching messages that are not present in the object you can also have “before” and “after” handlers that fire before/after the handler in the object.
One other caution - when you have a group set to "behave as a background", then it gets inserted in the message path as shown. If you only want it to capture messages for itself (when multiple backgrounds present), you must test for that and pass if appropriate. Here's one of my handlers where I do this:I ran into this because I needed the messages to know when the background was opened but also had multiple groups that needed this treatment.
One other caution - when you have a group set to "behave as a background", then it gets inserted in the message path as shown. If you only want it to capture messages for itself (when multiple backgrounds present), you must test for that and pass if appropriate. Here's one of my handlers where I do this:
CODE:
on preOpenBackground pBackgroundID if the id of me is not pBackgroundID then pass preOpenBackground updateStatus "preOpenBackground" && the short name of me & lf if sInitialized is not true then __Initializeend preOpenBackground
Statistics: Posted by bwmilby — Wed May 08, 2024 12:04 am