scale9Grid (Button.scale9Grid property)

public scale9Grid : Rectangle

The rectangular region that defines the nine scaling regions for the button. If set to null, the entire button is scaled normally when any scale transformation is applied.

When you define a scale9Grid property for a button, the button is divided into a grid with nine regions based on the scale9Grid rectangle, which defines the center region of the grid. There are eight other regions of the grid, as follows:

You can think of the eight regions outside of the center (defined by the rectangle) as a picture frame that has special rules applied to it when the button is scaled.

When the scale9Grid property is set and a button is scaled, all text and gradients are scaled normally; however, for other types of objects the following rules apply:

If a button is rotated, all subsequent scaling is normal, and the scale9Grid property is ignored.

A common use for the scale9Grid property is to set up a button in which edge lines retain the same width when the button is scaled.

For more information, including illustrations and a related example, see MovieClip.scale9Grid.

Availability: ActionScript 1.0; Flash Player 8

See also

Rectangle (flash.geom.Rectangle), scale9Grid (MovieClip.scale9Grid property)