526
Chapter 12: Methods
See also
Movie
setAlpha()
Usage
imageObject
.setAlpha(
alphaLevel
)
imageObject
.setAlpha(
alphaImageObject
)
Description
Function; sets the alpha channel of an image object to a flat alphaLevel or to an existing
alphaImageObject
. The
alphaLevel
must be a number from 0–255. Lower values cause the
image to appear more transparent. Higher values cause the image to appear more opaque. The
value 255 has the same effect as a value of zero. In order for the
alphaLevel
to have effect, the
useAlpha()
of the image object must be set to
TRUE
.
The image object must be 32-bit. If you specify an alpha image object, it must be 8-bit. Both
images must have the same dimensions. If these conditions are not met,
setAlpha()
has no effect
and returns FALSE. The function returns TRUE when it is successful.
Example
The following Lingo statement makes the image of the bitmap cast member Foreground opaque
and disables the alpha channel altogether. This is a good method for removing the alpha layer
from an image:
member("Foreground").image.setAlpha(255)
member("Foreground").image.useAlpha = FALSE
This Lingo gets the alpha layer from the cast member Sunrise and places it into the alpha layer of
the cast member Sunset:
tempAlpha = member("Sunrise").image.extractAlpha()
member("Sunset").image.setAlpha(tempAlpha)
See also
useAlpha
,
extractAlpha()
setaProp
Usage
setaProp list,
listProperty
,
newValue
setaProp
(
childObject
,
listProperty
,
newValue
)
list.
listProperty
=
newValue
list[
listProperty
] =
newValue
childObject.
listProperty
=
newValue
Description
Command; replaces the value assigned to
listProperty
with the value specified by
newValue
.
The
setaProp
command works with property lists and child objects. Using
setaProp
with a
linear list produces a script error.
•
For property lists,
setaProp
replaces a property in the list specified by
list
. When the
property isn’t already in the list, Lingo adds the new property and value.
•
For child objects,
setaProp
replaces a property of the child object. When the property isn’t
already in the object, Lingo adds the new property and value.
Содержание DIRECTOR MX 2004-DIRECTOR SCRIPTING
Страница 1: ...DIRECTOR MX 2004 Director Scripting Reference...
Страница 48: ...48 Chapter 2 Director Scripting Essentials...
Страница 100: ...100 Chapter 4 Debugging Scripts in Director...
Страница 118: ...118 Chapter 5 Director Core Objects...
Страница 594: ...594 Chapter 12 Methods...
Страница 684: ...684 Chapter 14 Properties See also DVD...
Страница 702: ...702 Chapter 14 Properties See also face vertices vertices flat...
Страница 856: ...856 Chapter 14 Properties JavaScript syntax sprite 15 member member 3 4...
Страница 889: ...netPresent 889 _player alert Sorry the Network Support Xtras could not be found See also Player...
Страница 1102: ...1102 Chapter 14 Properties...