776
Chapter 14: Properties
For linked Flash cast members, the
FlashRect
member property returns a valid value only when
the cast member’s header has finished loading into memory.
This property can be tested but not set.
Example
This sprite script resizes a Flash movie sprite so that it is equal to the original size of its Flash
movie cast member:
-- Lingo syntax
property spriteNum
on beginSprite me
sprite(spriteNum).rect = sprite(spriteNum).member.FlashRect
end
// JavaScript syntax
function beginSprite() {
sprite(this.spriteNum).rect = sprite(this.spriteNum).member.FlashRect;
}
See also
defaultRect
,
defaultRectMode
,
state (Flash, SWA)
flat
Usage
member(
whichCastmember
).shader(
whichShader
).flat
member(
whichCastmember
).model(
whichModel
).shader.flat
member(
whichCastmember
).model(
whichModel
).shaderList{[
index
]}.flat
Description
3D
#standard
shader property; indicates whether the mesh should be rendered with flat shading
(
TRUE
) or Gouraud shading (
FALSE
).
Flat shading uses one color per face of the mesh. The color used for the face is the color of its first
vertex. Flat shading is faster than Gouraud shading.
Gouraud shading assigns a color to each vertex of a face and interpolates the colors across the
face in a gradient. Gouraud shading requires more time and calculation, but creates a smoother
surface.
The default value for this property is
FALSE
.
Example
The following statement sets the
flat
property of the shader named Wall to
TRUE
. The mesh of a
model that uses this shader will be rendered with one color per face.
member("MysteryWorld").shader("Wall").flat = TRUE
See also
mesh (property)
,
colors
,
vertices
,
generateNormals()
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...