User's Manual
MediaScript Objects and Methods 135
•
•
•
•
•
setLayerEnabled()
Sets the specified layer as either enabled or disabled. If you use the collapse() function
without naming specific layers, MediaRich collapses all enabled layers and ignores
disabled layers. Use the setLayerEnabled() function or the eye icon in Photoshop to
enable/disable a layer. Use the getLayerEnabled() function to determine if a layer is
enabled or not.
Syntax
<object name>.setLayerEnabled(
<layer index>,
<true, false>
);
Parameters
The first parameter specifies the desired layer index (starting from zero).
If setLayerEnabled is set to true, the layer is enabled; if set to false, the layer is disabled.
Example
if (image.getLayerEnabled(2) == false)
image.setLayerEnabled(2, true);
...}
setLayerHandleX()
Sets the HandleX of the media layer with the specified index (if available).
Syntax
<object name>.setLayerHandleX(
<layer index>
<"position">
);
Parameters
The first parameter specifies the desired layer index (starting from zero).
The second parameter sets the selected layer’s attachment point on the x-axis. The default
is “Center.” Other options are “Left” and “Right”.
Example
var image = new Media();
image.setLayerHandleX(2, "Right");










