User Guide
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()