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).
Summary of Contents for DIRECTOR MX 2004-DIRECTOR SCRIPTING
Page 1: ...DIRECTOR MX 2004 Director Scripting Reference...
Page 48: ...48 Chapter 2 Director Scripting Essentials...
Page 100: ...100 Chapter 4 Debugging Scripts in Director...
Page 118: ...118 Chapter 5 Director Core Objects...
Page 594: ...594 Chapter 12 Methods...
Page 684: ...684 Chapter 14 Properties See also DVD...
Page 702: ...702 Chapter 14 Properties See also face vertices vertices flat...
Page 856: ...856 Chapter 14 Properties JavaScript syntax sprite 15 member member 3 4...
Page 1102: ...1102 Chapter 14 Properties...