A SERVICE OF

logo

88 Chapter 3
Example
var image = new Media();
image.load(name @ "peppers.psd");
if(image.getLayerName(2) == "GreenPepper")
{...
getLayerOpacity()
Returns the opacity of the media layer with the specified index (if available). For more
information about opacity settings, see “composite()” on page 63.
Syntax
<object name>.getLayerOpacity(
<layer index>
);
Parameters
layer index - specifies the desired layer index (starting from 0).
Example
var image = new Media();
image.load(name @ "peppers.psd");
if(image.getLayerOpacity(2) == 50)
{...
getLayerX()
Returns the X offset of the media layer with the specified index (if available).
NOTE: X and Y layer offsets determine relative positions of layers to each, and are used by the
collapse() function.
Syntax
<object name>.getLayerX(
<layer index>
);
Parameters
layer index - specifies the desired layer index (starting from 0).
Example
var image = new Media();
image.load(name @ "peppers.psd");
if(image.getLayerX(2) == 25)
{...