### scaleMode

Syntax: | `the scaleMode of sprite` `whichFlashSprite`
| `the scaleMode of member` `whichFlashMember`
Type: | Cast member and sprite property
Description: | This property controls the way a Flash movie is scaled within a sprite's bounding rectangle. When you scale a Flash movie sprite by setting its `scale` and `viewScale` properties, the sprite itself is not scaled, only the view of the movie within the sprite. The `scaleMode` property can have these values:

| `#showAll` Maintain the aspect ratio of the original Flash movie cast member. If necessary, fill in any gap on the horizontal or vertical dimension using the background color.
| `#noBorder` Maintain the aspect ratio of the original Flash movie cast member. If necessary, crop the horizontal or vertical dimension.
| `#exactFit` Do not maintain the aspect ratio of the original Flash movie cast member. Stretch the Flash movie to fit the exact dimensions of the sprite.

| The `scaleMode` property can be tested and set. The default setting is `#showAll`.
Example: | This sprite script checks the stage color of the Director movie and, if the stage color is indexed to position 0 in the current palette, it sets the `scaleMode` property of a Flash movie sprite to #`showAll`. Otherwise, it sets the `scaleMode` property to #`noBorder`.

    on beginsprite me
    	if the stagecolor = 0 then
    		set the scaleMode of sprite the spriteNum of me = #showAll
    	else
    		set the scaleMode of sprite the spriteNum of me = #noBorder
    end

Related Lingo: | `scale` property

Previous | Next