User Guide
defaultRectMode 727
// JavaScript syntax
function setDefaultFlashRect(whichCast, whichRect) {
var i = 1;
while( i < (castLib(whichCast).member.count) + 1)
var tp = member(i, whichCast).type;
if (tp = "flash") {
member(i, whichCast).defaultRect = whichRect;
i++;
}
}
}
See also
defaultRectMode, flashRect
defaultRectMode
Usage
-- Lingo syntax
memberObjRef.defaultRectMode
// JavaScript syntax
memberObjRef.defaultRectMode;
Description
Cast member property; controls how the default size is set for all new sprites created from Flash
movie or vector shape cast members. You specify the property value as a Director rectangle; for
example, rect(0,0,32,32).
The
defaultRectMode property does not set the actual size of a Flash movie’s default rectangle; it
only determines how the default rectangle is set. The
defaultRectMode member property can
have these values:
• #flash (default)—Sets the default rectangle using the size of the movie as it was originally
created in Flash.
• #fixed—Sets the default rectangle using the fixed size specified by the defaultRect
member property.
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, sets their
defaultRectMode property to #fixed, and then sets their
defaultRect property to rect(0,0,320,240).