rawNew()
491
Example
These statements create and display two randomly defined unit vectors in the Message window:
-- Lingo syntax
vec1 = randomVector()
vec2 = randomVector()
put(vec1 & RETURN & vec2)
// JavaScript syntax
var vec1 = randomVector();
var vec2 = randomVector();
put(vec1 + "\n" + vec2);
See also
vector()
randomVector
Usage
randomVector()
Description
3D command; returns a unit vector describing a randomly chosen point on the surface of a unit
sphere. This method differs from
vector( random(10)/10.0,
random(10)/10.0,
random(10)/10.0)
, in that the resulting vector is guaranteed to be a unit vector.
Parameters
None.
Example
These statements create and display two randomly defined unit vectors in the Message window:
vec = randomVector()
put vec
-- vector(-0.1155, 0.9833, -0.1408)
vec2 = randomVector()
put vec2
-- vector(0.0042, 0.8767, 0.4810)
See also
getNormalized
,
generateNormals()
,
normalize
rawNew()
Usage
parentScript
.rawNew()
rawNew(
parentScript
)
Description
Function; creates a child object from a parent script without calling its
on new
handler. This
allows a movie to create child objects without initializing the properties of those child objects.
This is particularly useful when you want to create large numbers of child objects for later use. To
initialize the properties of one of these raw child objects, call its
on new
handler.
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...