User Guide

589
setAlpha()
Syntax
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.
Examples
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
Syntax
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
isnt 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 isnt
already in the object, Lingo adds the new property and value.
The setaProp command can also set ancestor properties.