Lingo Dictionary > D-F > defaultRect |  |

defaultRect

Syntax

    member(whichFlashOrVectorShapeMember).defaultRect
    the defaultRect of member whichFlashOrVectorShapeMember

Description

Cast member property; controls the default size used for all new sprites created from a Flash movie or vector shape cast member. The `defaultRect` setting also applies to all existing sprites that have not been stretched on the Stage. You specify the property values as a Director rectangle; for example, rect(0,0,32,32).

The `defaultRect` member property is affected by the cast member's `defaultRectMode` member`` property. The `defaultRectMode` property is always set to `#Flash` when a movie is inserted into a cast, which means the original `defaultRect` setting is always the size of the movie as it was originally created in Flash. Setting `defaultRect` after that implicitly changes the cast member's `defaultRectMode` property to `#fixed`.

This property can be tested and set.

Example

This handler accepts a cast reference and a rectangle as parameters. It then searches the specified cast for Flash cast members and sets their `defaultRect` property to the specified rectangle.

    on setDefaultFlashRect whichCast, whichRect
    	repeat with i = 1 to the number of members of castLib whichCast
    		if member(i, whichCast).type = #flash then
    			member(i, whichCast).defaultRect = whichRect
    		end if
    	end repeat
    end

See also

`defaultRectMode`, `flashRect`