A SERVICE OF

logo

MediaScript Objects and Methods 81
flip()
Flips the media vertically or horizontally. This function fully supports images within the
CMYK color space.
Syntax
flip(
Axis @ <"Horizontal, Vertical">
[layers @ <"layer list">] // (PSD files only)
);
Parameters
Axis - designates along which axis (horizontal or vertical) to flip the media.
layers - for PSD files, specifies the layers to be affected. The layer numbers begin at 0
(background) and go up. For more information see “load()” on page 101.
Example
var image = new Media();
image.load(name @ "pasta.tga");
image.flip(axis @ "horizontal");
image.save(type @ "jpeg");
frameAdd()
Adds the given frame(s) to the specified Media object. If the Media object already contains
one or more images, any frames added are cropped and converted to match the first frame
in the media. This function fully supports the CMYK color space.
Before you can add a frame, you must load() the image you want to add.
NOTE: When using frameAdd() within a JavaScript for loop: including Draw functions
(line(), ellipse(), etc.) within the loop to mask other frames can result in initially poor
anti-aliasing.
Syntax
frameAdd(
[Source @ <user-defined Media object name>]
[Name @ <"filename", "virtualfilesystem:/filename">]
[Duration <1 .. 300000>]
);