Working with Models and Model Resources
481
The extruder model resource
You can create extruder model resources only by using an existing text cast member. In many
cases, you may choose to use the 3D text capabilities of the Property inspector instead.
Creating an extruder model resource is simple. If member 1 is a text cast member and member 2
is a 3D cast member, use the following Lingo:
member(1).extrude3d(member(2))
This generates a model resource in member 2 that is an extrusion of the 2D text in member 1.
Cast member commands
If the models and model resources you need aren’t contained in a particular cast member, the
following commands allow you to create models and model resources using other 3D cast
members at runtime.
emitter.grav
ity
Get and set
Vector representing simulated gravity. The
vector’s length indicates its strength.
Any vector.
emitter.wind
Get and set
A vector representing simulated wind pushing
particles in a given direction. The vector’s length
indicates its strength.
Any vector.
Command
Description
Returns
loadFile
(
fileName,
Overwrite,
GenerateUnique
Names
)
This command loads a W3D format file from
fileName
,
adds all models as children of the world, and updates all
palettes.
You can call this function only if the cast member’s state
property is either
-1
, meaning that an error occurred during
a previous attempt to load the file, or
4
, meaning that media
loading is complete. If an attempt is made to call
loadFile
while the cast member is streaming media in, a
Lingo error is generated.
Overwrite
is an optional variable that can be
TRUE (1)
or
FALSE (0)
:
TRUE (1)
means the old world is replaced by the contents
of the file.
FALSE (0)
means the new file is merged into the existing
world.
GenerateUniqueNames
is a variable that has no
meaning unless
Overwrite
is
FALSE (0)
.
If
Overwrite
is
FALSE (0)
, then if
GenerateUniqueNames
is
TRUE (1)
, all new
elements sharing the same name as existing elements are
assigned a new, algorithmically determined unique name.
If
GenerateUniqueNames
is
FALSE (0)
, all existing
elements sharing the same name as new elements being
read into the file are replaced by the new elements.
Nothing if the operation
is successful, or a Lingo
error if the operation fails
cloneModelFrom
Castmember
(
name, model,
castmember
)
Performs a deep clone of a model from one cast member
and puts it into another cast member.
The model, its resources, its children, and its children’s
resources all are put into the new cast member.
A model object
Property
Access
Description
Value Range
Содержание DIRECTOR MX-USING DIRECTOR MX
Страница 1: ...Using Director MX Macromedia Director MX...
Страница 12: ...Contents 12...
Страница 156: ...Chapter 4 156...
Страница 202: ...Chapter 6 202...
Страница 244: ...Chapter 7 244...
Страница 292: ...Chapter 10 292...
Страница 330: ...Chapter 12 330...
Страница 356: ...Chapter 13 356...
Страница 372: ...Chapter 14 372...
Страница 442: ...Chapter 16 442...
Страница 472: ...Chapter 18 472...
Страница 520: ...Chapter 19 520...
Страница 536: ...Chapter 20 536...
Страница 562: ...Chapter 23 562...
Страница 566: ...Chapter 24 566...
Страница 602: ...Chapter 27 602...