Livecode Wiki
Advertisement

Specifies whether the group will behave as a shared group.Syntax:

get the sharedBehavior of group myGroup

Examples:

set the sharedBehavior of group 1 to true
get the sharedBehavior of group "myGroupName"
put it into tSharedBehavior
put the sharedBehavior of group myGroup into tSharedBehavior
set the sharedBehavior of group 1 to true
place group 1 onto card 2 of this stack

Use the sharedBehavior property to make a group behave as a shared group and place it on more than one card.

Only top-level groups may be shared groups; an attempt to set the sharedBehavior of a nested group to true will throw an error.

A shared group behaves identically to a normal group except that it is not owned by any one card. This means that if a shared group is present on only one card and that card is deleted, the shared group will not be deleted. Instead, the group will become 'unplaced', allowing it to placed onto other cards in the future.

The group can still be explicitly deleted using the delete command, in which case it will be removed from all cards on which it is placed.

An attempt to set the sharedBehavior of a shared group to false when it is placed on more than one card, or not placed on any cards will through an error. To change a shared group to a normal group, the group must be present on exactly one card.

See also: backgroundBehavior (property),sharedGroupIds (property),sharedGroupNames (property),

Advertisement