How to make the group itself a target

Peter Haworth pete at lcsql.com
Fri Apr 1 23:44:56 EDT 2016


the short name of the owner of me

On Fri, Apr 1, 2016, 8:09 PM Sannyasin Brahmanathaswami <brahma at hindu.org>
wrote:

> 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
>
>
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>



More information about the use-livecode mailing list