
MediaScript Objects and Methods 89
•
•
•
•
getLayerY()
Returns the Y 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>.getLayerY(
<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.getLayerY(2) == 25)
{...
getMetaData()
Returns a metadata string of the specified format associated with a Media object.
MediaRich allows users to assign arbitrary key/value pairs to any Media object using the
setMetaData() function. The getMetaData() function returns the value as a string.
Syntax
var xmlDoc = <object name>.getMetadata(<"format">);
Parameters
The specified format is the key of the key/value pair. Valid values are “Exif”, “IPTC”, or
“XMP”.
Example
var image = new Media();
image.load(name @ "peppers.psd");
image.getMetaData("Exif");
{...
getPalette()
Returns an array of integers containing the colors in the palette or null if the image does
not have a palette. The RGB components of these colors can be obtained using the
RGBColor object defined in sys/color.ms. If the image has no palette the array is empty.
Syntax
palColors = <object name>.getPalette();
Parameters
This function has no parameters.