Macro Language Reference > Macros > Page > tplay
  
tplay
Description
Creates, assigns or removes a specified overlay or underlay page layout to or from a specified range of pages.
The macro is enhanced from release 10.0 to support additional ways of creating named layers, as well as additional ways of adding new frames to a layer, and a way to copy frames from a named layer to the default <page> layer. The enhancement is that the tag name now refers to a Layer control stream or a PageDef control stream and can optionally be preceded by the > symbol.
 
Example 170. Add an underlay to a specific page range
The macro below adds an underlay called name to pages 1--30, creating it if it does not already exist:
tplay 1, "name", 1, 30
 
Example 171. Remove an underlay from page 2
tplay -"name", 2
 
Example 172. Select an underlay page called name
tpgoto "name"
Syntax
tplay( lay_type:n ',' )? ( ( -:L ) | ( :L ) )? name:t (',' start_page:n ',' end_page:n )? (',' mode:s )?
tplay
[no parameter]
Invoke the Add/Remove Over/Underlay dialog box.
lay_type
0
Create a new overlay (default)
1
Create a new underlay
This parameter only applies when creating a layer: if removing a layer, this parameter is not needed.
-
Indicates that the following layer name should be removed from the current PageDef.
For example:
tplay -"name"
>
Indicates that a new named layer (a layer control stream) is to be created from the frames currently on the default <page> layer. The <page> layer will be emptied and an instance of the new named layer will be added to the current PageDef. If the target named layer already exists it will be overwritten with the new layer (without warning). If the tag name already exists and is a different type, the tag will not be overwritten and the frames that were on the <page> layer will be lost.
For example:
tplay >"name"
Using an empty name (i.e. "") is a very special case: all frames on all layers in the current PageDef will be copied (in the same order) to the current default <page> layer, and the current page is switched to a new, empty [unnamed] PageDef. Effectively, the current page is ‘flattened’ as all layers are removed.
For example:
tplay >""
lay_name
Usually the layer control stream tag name.
Must be declared in double quotes.
If there is a preceding >character, this will be the tag name to which to create and write to (see above). If not, it will be the tag name to use to create an instance of the layer on the currently selected PageDef; if the tag does not exist, it will be created.
When not preceded by the > symbol, this parameter can also be a PageDef control stream tag name. In this case, the add or remove operation is repeated for every layer name currently in the PageDef. This makes it easy to add or remove all layers from one PageDef to another.
For example:
tplay "name"
start_page
The first page on which the add or remove action should apply
end_page
The last page on which the add or remove action should apply
mode
The mode of the overlay or underlay:
+
Enabled (default)
-, x, X,
Disabled
?
Controlled by <?layer> PI
Additional Information
Assigning an overlay or underlay to a page effectively adds all of the underlay or overlay's frames to the page. An underlay's frames are added before any existing frames on the page (i.e. given lower numbers). An overlay's frames are added after the existing ones (higher numbers). If more than one overlay or underlay is assigned to a page (to a maximum of 10) the frames will be added in the same order as the overlays or underlays were added. There is no easy way to change the order of overlays or underlays once they are added, they would have to be removed and then reassigned in the correct order.
Once created an overlay cannot be converted to an underlay or vice versa, other than by editing the .3d file in an ASCII text editor and changing the word underlay to overlay.
Related Links