Mark A. Boyd's

[MBlogo Animation]  mboyd.com  [MBlogo Animation]

showhide.dir

[myDirector] [Home]

There are several posts in the online Director users fora inquiring about hiding and showing groups of sprites. I've been using this behavior, "MAB beginOffStageGrouped", in nearly every project to hide/show groups of sprites - custom dialog boxes are the most common, but sometimes I hide/show volume control sprites & such.

The easiest way to use this behavior is to select all the sprites you want to group together and drop this behavior on them. It will call up a property dialog box that allows you to set the initial position of the sprites (on or off stage) and type a group name.

There are more possible combinations than I've supplied in the checkboxes, but in most cases you'll just want to toggle a single group on or off. The most common call I use on a mouseUp is shown in the command line, so don't let my multi-function "bhv_hide" behavior throw you off. I just hacked it together for this example & it uses some hard-coded grouping methods for the check boxes that I don't really recommend.

The behavior also has some features that are not used in this example, such as specifying a relative location rather than using the sprites' initial positions. There are a few comments in the code, but you can experiment with it as you like.

Select a color group to show, hide, or toggle the sprite positions.

Download showhide.dir

Director 7 script. To use with D8 or higher replace all ¬ characters with \.


Home