### defaultRect

Syntax: | `the defaultRect of member` `whichFlashMember`
Type: | Cast member property
Description: | This property controls the default size used for all new sprites created from a Flash movie cast member. The `defaultRect` setting also applies to all existing sprites that have not been stretched on stage. You specify the property values as a Director rect; for example, rect(0,0,32,32).
| The `defaultRect of member` property is affected by the cast member's `defaultRectMode of 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 the `defaultRect` property after that implicitly changes the cast member's `defaultRectMode` property to `#fixed`.
| The `defaultRect of member` property can be tested and set.
Example: | This handler accepts a cast reference and a rect as parameters. It then searches the specified cast for Flash cast members and sets their `defaultRect` property to the specified rect.

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

Related Lingo: | `FlashRect of member` property, `defaultRectMode of member` property

Previous | Next