MACROMEDIA DIRECTOR MX 2004-DIRECTOR SCRIPTING Reference page 296

Director scripting reference
Table of Contents

Advertisement

dotProduct()
Usage
vector1.dotProduct(vector2)
Description
3D vector method; returns the sum of the products of the x, y, and z components of two vectors.
If both vectors are normalized, the
To manually arrive at the dot of two vectors, multiply the x component of
component of
vector2
, then multiply the z component of
vector2
add the three products together.
This method is identical to
Parameters
Required. The second vector from which a sum is returned.
vector2
Example
In this example, the angle between the vectors
function returns the normalized values of
and
. The
norm2
pos5 = vector(100, 100, 0)
pos6 = vector(0, 100, 0)
put pos5.angleBetween(pos6)
-- 45.0000
norm1 = pos5.getNormalized()
put norm1
-- vector( 0.7071, 0.7071, 0.0000 )
norm2 = pos6.getNormalized()
put norm2
-- vector( 0.0000, 1.0000, 0.0000 )
put norm1.dotProduct(norm2)
-- 0.7071
See also
dot(), getNormalized,
downloadNetThing
Usage
downloadNetThing URL, localFile
Description
Command; copies a file from the Internet to a file on the local disk, while the current movie
continues playing. Use
Director movies in authoring mode and projectors support the
but the Shockwave Player does not. This protects users from unintentionally copying files from
the Internet.
296
Chapter 12: Methods
dotproduct
, then multiply the y component of
function.
dot()
of
dotProduct
norm1
normalize
to find out whether downloading is finished.
netDone
is the cosine of the angle between the two vectors.
vector1
by the z component of
vector1
and
pos5
pos6
and
, and stores them in the variables
pos5
pos6
and
is 0.7071, which is the cosine of 45°.
norm2
vector1
by the y component of
vector2
is 45°. The
getNormalized
command,
downLoadNetThing
by the x
, and finally
norm1

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the DIRECTOR MX 2004-DIRECTOR SCRIPTING and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

This manual is also suitable for:

Director mx 2004

Table of Contents