Message path, behaviors and groups

Graham Samuel livfoss at mac.com
Sun Apr 15 11:56:54 EDT 2012


I greedily want to have two behaviors for a set of cards in something I'm developing. Basically I clone cards from templates, and there are several different templates. There is a set of common behaviors for all the cards, so there's a script for this that gets put in a button and then set as the behavior of each card as  it's created from the template; then I want each type of template to have an additional behavior unique to the specific type of card  being created. I achieve this by having a common group on each card, and setting the behavior of this group according to the type of template I'm using.

This kind of works, in that the handlers in the second set of behaviors are accessible from controls (such as fields) on the relevant card - but if I have buttons in the group where I put the behavior, they don't see the handlers in the behavior, even if I try to access them via 'send' as in

on mouseUp
  send "dosomething" to grp "theCommonGroup" of this cd
end mouseUp

Is there a way to solve this? If not, I can put the handlers I want in the main behavior, with a parameter which says who's calling them so that they can modify what they do according to the specific requirements of the caller, but that seems clunky.

TIA

Graham




More information about the use-livecode mailing list