EasyManua.ls Logo

MACROMEDIA DIRECTOR MX 2004-DIRECTOR SCRIPTING - Page 149

MACROMEDIA DIRECTOR MX 2004-DIRECTOR SCRIPTING
1130 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Sprite 149
See also
Member, Sprite
Shader
Represents a models surface color.
You can draw images on the surface of a model by applying one or more textures to each shader.
You can create a reference to a shader by using the
shader property of the 3D Member object. The
shader property gets the shader at a specified index position in the list of shaders. In Lingo, you
use the
shader property directly from the 3D Member object to create a reference. In JavaScript
syntax, you must use the
getPropRef() method to create a reference.
The following example creates a reference to the second shader of the 3D cast member
triangle
and assigns it to the variable
myShader.
-- Lingo syntax
myShader = member("triangle").shader[2]
// JavaScript syntax
var myShader = member("triangle").getPropRef("shader", 2);
Sprite
Represents a 3D sprite created from a Shockwave 3D cast member.
You can create a reference to a 3D sprite by using the top level
sprite() function, the Movie
object’s
sprite property, or the Sprite Channel objects sprite property. These are the same
techniques you can use to create a reference to a non-3D sprite.
Use the top level sprite() function.
-- Lingo syntax
3dSprite = sprite(1)
// JavaScript syntax
var 3dSprite = sprite(1);
Use the Movie objects sprite property.
-- Lingo syntax
3dSprite = _movie.sprite["willowTree"]
// JavaScript syntax
var 3dSprite = _movie.sprite["willowTree"];
Use the Sprite Channel objects sprite property.
-- Lingo syntax
3dSprite = channel(3).sprite
// JavaScript syntax
var 3dSprite = channel(3).sprite;

Related product manuals