How to make the group itself a target

Sannyasin Brahmanathaswami brahma at hindu.org
Fri Apr 1 23:09:08 EDT 2016


Assume we have a small group duplicated on the card 10-20 times.

each group contains three objects named

portal-link-background
portal-link-label
portal-link-thumbnail

The above is grouped... acts as a template; and is programatically duplicated X number of times

Each of the resulting groups is assigned a unique name

home
surprises
learn
practice
audio
visuals

etc.

Now I want to set a behavior that will return the name of the group on mouse up.

the target won't work, because the mouse up is trapped by the field, background or image in the group so the group itself is never the target.

I realize I can test for the long id of the target, then extract the name of the group from that.

field id 1348 of group id 1346 of group id 1354 of card id 1082 of stack "/Users/Brahmanathaswami/Documents/App Development/SivaSiva App/App Source/SivaSiva.livecode"
put the long idea of the target into tTargetID

go to card (the short name of group (word 7 of tTargetID)

I always prefer not parsing this kind of string for hard values, as things can change...

 But  this is the only method I can think of.  Is there a better way? Obviously we dont' want to be putting "pass mouseup" into all the child elements of the group, as that breaks the whole point of using a behavior.

BR





More information about the use-livecode mailing list