How to relayer grouped controls

This lesson will show you how to relayer controls that are contained within a group.

To try out the sample stack click here.

Relayering grouped controls

Relayering grouped controls

The sample stack contains 2 groups each consisting of a background graphic and 2 fields. These 2 groups are in turn grouped together in a main group.

In order to relayer controls that are contained within a group you must set the relayerGroupedControls property to true. That then allows you to relayer grouped controls in script.

on mouseUp

set the relayerGroupedControls to true

 

set the layer of group "A" to the layer  of group "B"

 

put "Layer:" && the layer of group "A" into field "layer" of group "A"

put "Layer:" && the layer of group "B" into field "layer" of group "B"

set the relayerGroupedControls to false

end mouseUp

Note: remember to set the relayerGroupedControls property back to false when you are done. While it is set to true controls can move in and out of groups when their layers are changed which might cause unexpected behavior if this is not what you want.

0 Comments

Add your comment

E-Mail me when someone replies to this comment