Skip to content

anim-format (runtime format) / PlaybackAction

Type Alias: PlaybackAction ​

ts
type PlaybackAction = 
  | {
  target: string;
  type: "target";
}
  | {
  type: "play";
}
  | {
  type: "stop";
}
  | {
  type: "togglePlay";
}
  | {
  type: "stopAll";
}
  | {
  scene: string;
  then?: "play" | "stop";
  type: "scene";
}
  | {
  frame: string;
  section?: string;
  then?: "play" | "stop";
  type: "gotoNow";
}
  | {
  frame: string;
  section?: string;
  then?: "play" | "stop";
  type: "gotoAfter";
}
  | {
  frame: string;
  section?: string;
  type: "playTo";
}
  | {
  type: "nextFrame";
}
  | {
  type: "prevFrame";
}
  | {
  type: "nextScene";
}
  | {
  type: "prevScene";
}
  | {
  duration?: number;
  fps: number;
  scope: "global" | "self";
  type: "setFps";
}
  | {
  duration?: number;
  scope: "global" | "self";
  type: "resetFps";
}
  | {
  type: "stopSounds";
}
  | {
  onEnd?: PlaybackAction[];
  sound: string;
  type: "playSound";
}
  | {
  sound: string;
  type: "stopSound";
}
  | {
  type: "setVisible";
  visible: boolean;
}
  | {
  input: string;
  type: "setInput";
  value:   | number
     | boolean
     | string
     | {
     x: number;
     y: number;
   };
}
  | {
  frame: string;
  section?: string;
  times: number;
  type: "repeat";
}
  | {
  frames: string[];
  range?: {
     from: number;
     to: number;
  };
  then?: "play" | "stop";
  type: "gotoRandom";
}
  | {
  seconds: number;
  type: "wait";
}
  | {
  backward: boolean;
  type: "setDirection";
}
  | {
  args?: (number | string | boolean)[];
  fn: string;
  script: string;
  type: "call";
}
  | {
  name: string;
  type: "emit";
  value?: unknown;
}
  | {
  loop?: boolean;
  parts?: string;
  section: string;
  type: "overlay";
}
  | {
  blank?: boolean;
  type: "openUrl";
  url: string;
}
  | {
  kind: string;
  params?: Record<string, number | string | boolean>;
  seconds: number;
  type: "canned";
};

Playback actions (editor: playback layers + instance triggers). A target step's path is dotted, from the running clip — _parent, _root, _children[n] (n-th child clip, bottom → top), this, or a child's object name / instance id (AnimLayer.obj.n / SymbolItem.id); absent = that clip. Frame numbers are 0-based numeric strings (frames of the scene, or of section), labels or SECTION_START / SECTION_END. A list is a CHAIN (runChain): a playTo / wait holds the rest until it is done. Players skip unknown types.

Union Members ​

Type Literal ​

ts
{
  target: string;
  type: "target";
}

target step: the actions after it act on target until the next target step that does not directly follow one; steps in a row add up (A, B, stop = both stop). Before any = the running clip. runChain = THE rule


Type Literal ​

ts
{
  type: "play";
}

Type Literal ​

ts
{
  type: "stop";
}

Type Literal ​

ts
{
  type: "togglePlay";
}

Type Literal ​

ts
{
  type: "stopAll";
}

stop the target and every clip nested in it (synced ones follow)


Type Literal ​

ts
{
  scene: string;
  then?: "play" | "stop";
  type: "scene";
}

to another scene: alone = its first frame; right before a goto / playTo / repeat / gotoRandom of the same target = that one looks there


Type Literal ​

ts
{
  frame: string;
  section?: string;
  then?: "play" | "stop";
  type: "gotoNow";
}

then: "play" = gotoAndPlay, "stop" = gotoAndStop, absent = keep state; section = frame inside that section (resolveFrameRef)


Type Literal ​

ts
{
  frame: string;
  section?: string;
  then?: "play" | "stop";
  type: "gotoAfter";
}

the same jump, but only once the playhead leaves this frame (the frame is shown for its time first; replaces the step to the next frame). Any other playhead move before that cancels it


Type Literal ​

ts
{
  frame: string;
  section?: string;
  type: "playTo";
}

play forward or backward to the frame (never out of its section), stop there


Type Literal ​

ts
{
  type: "nextFrame";
}

Type Literal ​

ts
{
  type: "prevFrame";
}

Type Literal ​

ts
{
  type: "nextScene";
}

Type Literal ​

ts
{
  type: "prevScene";
}

Type Literal ​

ts
{
  duration?: number;
  fps: number;
  scope: "global" | "self";
  type: "setFps";
}

global = every clip without its own speed; self = the target. duration seconds = a linear ramp


Type Literal ​

ts
{
  duration?: number;
  scope: "global" | "self";
  type: "resetFps";
}

Type Literal ​

ts
{
  type: "stopSounds";
}

Type Literal ​

ts
{
  onEnd?: PlaybackAction[];
  sound: string;
  type: "playSound";
}

onEnd = actions run (on the same clip) when the sound finishes


Type Literal ​

ts
{
  sound: string;
  type: "stopSound";
}

Type Literal ​

ts
{
  type: "setVisible";
  visible: boolean;
}

Type Literal ​

ts
{
  input: string;
  type: "setInput";
  value:   | number
     | boolean
     | string
     | {
     x: number;
     y: number;
   };
}

an Input of the target's timeline (AnimValues.in, by name) gets value — as clip.inputs[input] = value


Type Literal ​

ts
{
  frame: string;
  section?: string;
  times: number;
  type: "repeat";
}

back to frame (playing) times times on this clip, then go on


Type Literal ​

ts
{
  frames: string[];
  range?: {
     from: number;
     to: number;
  };
  then?: "play" | "stop";
  type: "gotoRandom";
}

Type Literal ​

ts
{
  seconds: number;
  type: "wait";
}

hold the playhead, play on after seconds


Type Literal ​

ts
{
  backward: boolean;
  type: "setDirection";
}

play backward (true) or forward from now on


Type Literal ​

ts
{
  args?: (number | string | boolean)[];
  fn: string;
  script: string;
  type: "call";
}

calls fn(...args) on the target's script (Behaviour) made from the script file script (an id in AnimFile.scripts). Additive in v1.


Type Literal ​

ts
{
  name: string;
  type: "emit";
  value?: unknown;
}

tells the GAME something happened (owner 2026-11-15): the player fires clip.on(name) on the target clip and the event BUBBLES up through the clips holding it (anim-format clipEvent.ts = THE dispatch; e.frame / e.section / e.value / e.target, e.stopPropagation()). value = any plain JSON, or absent. Moves no playhead (controlsPlayhead false). Additive in v1.


Type Literal ​

ts
{
  loop?: boolean;
  parts?: string;
  section: string;
  type: "overlay";
}

plays section section of the target's timeline on the parts parts only (parts.ts PartSpec, commas = several; absent = all) while its playhead goes on with the rest (owner gap plan #15, pixi-hm05 clip.overlay); loop = until stopped, else once; section "" = stop the overlays on parts (absent = all). Moves no playhead. Additive in v1 (older players skip it).


Type Literal ​

ts
{
  blank?: boolean;
  type: "openUrl";
  url: string;
}

click lists only: opens url here or in a new window (blank). Additive in v1


Type Literal ​

ts
{
  kind: string;
  params?: Record<string, number | string | boolean>;
  seconds: number;
  type: "canned";
}

canned motion kind (@utils/pure/canned) on the target clip for seconds, on top of its timeline's place; a leaving one holds its end unless params.hold is false. Additive in v1 (hm05-lite skips it)

HereSplash — 2D animation for the web