User's Manual

86 Chapter 3
getLayerEnabled()
Returns true if the named layer is enabled (visible), false if not. If you use the
collapse() function without naming specific layers, MediaRich collapses all enabled
layers and ignores disabled layers. Use the getLayerEnabled() function to determine
if a layer is enabled or not. Use the setLayerEnabled() function or the eye icon in
Photoshop to enable/disable a layer.
Syntax
<object name>.getLayerEnabled(
<layer index>
);
Parameters
layer index - specifies the desired layer index (starting from 0).
Example
if (image.getLayerEnabled(2) == false)
image.setLayerEnabled(2, true);
...}
getLayerHandleX()
Returns the HandleX value (“left”, “center”, or “right”) of the media layer with the
specified index (if available). HandleX refers to the selected layer’s attachment point on the
x-axis.
Syntax
<object name>.getLayerHandleX(
<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.getLayerHandleX(0) == "Center")
{...
getLayerHandleY()
Returns the HandleY value (“top”, “middle”, or “bottom”) of the media layer with the
specified index (if available). HandleY refers to the selected layer’s attachment point on the
y-axis.