Linked stretching (auto-scaling objects)

You can use named objects to stretch other named objects.

An example is a button with text on it. Changing the text could automatically stretch the button to match the new width. The following instructions use this example of text stretching a button. (For a simple example like this you would normally use the Button & NavBar Tool and convert them into a button - more details.)

Naming objects

Both the button and the text must be named objects. So the first step is to give separate names to the text and the button.

1. Select the first object you want to name (for this example either the text or the button). For more information see Selecting objects.

2. You can use either the Selector Tool or the Name Gallery.

In the Selector Tool click Create new name. Enter the name you want and click Apply.

In the Name Gallery click New. Enter the name you want and click Apply.

3. Name the other object.

Making named objects auto-stretching

You need to flag the name of the button (as this is the object that stretches). No action is needed for the name of the text.

1. In the Name Gallery select Stretches from the Properties drop-down list.

2. Click the arrow to the right of the button name. This displays the Extend dialog box. Full information on this dialog box.

3. In this dialog box select the check box for the text name.

4. Select how you want the button to stretch.

5. Click OK.

Now when you change the text, the button size automatically changes.

Notes

You can turn off auto-scaling temporarily by deselecting the check box to the right of the button name.

You can still scale the button in the regular way.

Several objects can share a common name. Also an object can have more than one name.

All objects that use the button name stretch as you change the size of the text.

If more than one object shares the name of the text, stretching occurs when the size of the bounding box changes.

Creating navigation bar buttons with text on them makes the buttons auto-stretching. You can temporarily switch off stretching by deselecting Live stretching on the Button & NavBar Tool Infobar.

_______________

Related Topics