@pixi/animate
Version:
PIXI plugin for the PixiAnimate Extension
1 lines • 55.3 kB
Source Map (JSON)
{"version":3,"file":"MovieClip.mjs","sources":["../../src/animate/MovieClip.ts"],"sourcesContent":["import { Timeline } from './Timeline';\nimport { TweenProps, EaseMethod, getEaseFromConfig, KeyframeData } from './Tween';\nimport { utils } from './utils';\nimport { sound } from './sound';\nimport { AnimateContainer } from './Container';\nimport type { AnimateDisplayObject } from './DisplayObject';\nimport { Ticker } from '@pixi/ticker';\nimport { settings } from '@pixi/settings';\nimport type { Graphics } from '@pixi/graphics';\nimport type { Sprite } from '@pixi/sprite';\nimport type { IDestroyOptions } from '@pixi/display';\nconst SharedTicker = Ticker.shared;\n\nexport interface MovieClipOptions\n{\n /**\n * The default playback mode is independent (0). Child movieclips are given a different value as subordinate objects.\n */\n mode?: number;\n /**\n * The starting frame. Default is 0.\n */\n startPosition?: number;\n /**\n * If playback is looped. Default is true.\n */\n loop?: boolean;\n /**\n * The frame labels map - label to frames\n */\n labels?: LabelMap;\n /**\n * The duration of the clip. If no duration is provided, length is automatically determined.\n */\n duration?: number;\n /**\n * The framerate to use for an independent mode MovieClip. Default is 24.\n */\n framerate?: number;\n}\n\nexport interface FrameLabel\n{\n label: string;\n position: number;\n}\n\nexport interface LabelMap\n{\n [label: string]: number;\n}\n\nexport type FrameAction = (this: MovieClip) => void;\n\ntype TimedChildTimeline = boolean[] & {target?: AnimateDisplayObject};\n\n/**\n * Provide timeline playback of movieclip\n */\nexport class MovieClip extends AnimateContainer\n{\n /**\n * The MovieClip will advance independently of its parent, even if its parent is paused.\n * This is the default mode.\n */\n public static readonly INDEPENDENT = 0;\n\n /**\n * The MovieClip will only display a single frame (as determined by the startPosition property).\n */\n public static readonly SINGLE_FRAME = 1;\n\n /**\n * The MovieClip will be advanced only when its parent advances and will be synched to the position of\n * the parent MovieClip.\n */\n public static readonly SYNCHED = 2;\n\n /**\n * The default framerate if none is specified or there's not parent clip with a framerate.\n */\n public static readonly DEFAULT_FRAMERATE = 24;\n\n /**\n * Fast way of checking if a movie clip is actually a movie clip.\n * Prevents circular references and is faster than instanceof.\n */\n public isMovieClip = true;\n\n /**\n * Controls how this MovieClip advances its time. Must be one of 0 (INDEPENDENT), 1 (SINGLE_FRAME), or 2 (SYNCHED).\n * See each constant for a description of the behaviour.\n */\n public mode: number;\n\n /**\n * Specifies what the first frame to play in this movieclip, or the only frame to display if mode is SINGLE_FRAME.\n */\n public startPosition: number;\n\n /**\n * Indicates whether this MovieClip should loop when it reaches the end of its timeline.\n */\n public loop: boolean;\n\n /**\n * The current frame of the movieclip.\n * @readOnly\n */\n public currentFrame: number;\n\n /**\n * The collection of private labels\n */\n private _labels: FrameLabel[];\n\n /**\n * The collection of private labels\n */\n private _labelDict: LabelMap;\n\n /**\n * If true, this movieclip will animate automatically whenever it is on the stage.\n */\n public selfAdvance: boolean;\n\n /**\n * If true, the MovieClip's position will not advance when ticked.\n */\n public paused: boolean;\n\n /**\n * If true, actions in this MovieClip's tweens will be run when the playhead advances.\n */\n public actionsEnabled: boolean;\n\n /**\n * If true, the MovieClip will automatically be reset to its first frame whenever the timeline adds\n * it back onto the display list. This only applies to MovieClip instances with mode=INDEPENDENT.\n * <br><br>\n * For example, if you had a character animation with a 'body' child MovieClip instance\n * with different costumes on each frame, you could set body.autoReset = false, so that\n * you can manually change the frame it is on, without worrying that it will be reset\n * automatically.\n */\n public autoReset: boolean;\n\n /**\n * Offset from parent frame for a synched movieclip.\n */\n private _synchOffset: number;\n\n /**\n * Previous position that this movieclip was stopped on.\n */\n private _prevPos: number;\n\n /**\n * Note - changed from default: When the MovieClip is framerate independent, this is the time\n * elapsed from frame 0 in seconds.\n */\n private _t: number;\n\n /**\n * By default MovieClip instances advance one frame per tick. Specifying a framerate for the MovieClip\n * will cause it to advance based on elapsed time between ticks as appropriate to maintain the target\n * framerate.\n */\n protected _framerate: number;\n\n /**\n * The total time in seconds for the animation. This is changed when setting the framerate.\n */\n private _duration: number;\n\n /**\n * The total duration in frames for the animation.\n */\n private _totalFrames: number;\n\n /**\n * Standard tween timelines for all objects. Each element in the _timelines array\n * is a Timeline object - an array of tweens for one target, in order of occurrence.\n */\n protected _timelines: Timeline[];\n\n /**\n * Array of child timelines denoting if a child is actively a child of this movieclip\n * on any given frame. Each element in the _timedChildTimelines is an array with a 'target'\n * property, and is an array of boolean values indexed by frame.\n * @private\n */\n public _timedChildTimelines: TimedChildTimeline[];\n\n /**\n * Array to depth sort timed children\n */\n protected _depthSorted: AnimateDisplayObject[];\n\n /**\n * Array of frame scripts, indexed by frame.\n */\n protected _actions: FrameAction[][];\n\n /**\n * Optional callback fired before timeline is updated.\n * Can be used to clamp or update the currentFrame.\n * @private\n */\n public _beforeUpdate: (target: MovieClip) => (() => void | null);\n\n /**\n * Internal property used to control child MovieClips relative to parents.\n */\n private parentStartPosition: number;\n\n /**\n * @param options - The options object\n */\n constructor(options?: MovieClipOptions);\n /**\n * @param mode - The playback mode default is independent (0),\n * @param duration - The duration, if no duration is provided, auto determines length\n * @param loop - If playback is looped\n * @param framerate - The framerate to use for independent mode\n * @param labels - The frame labels map of label to frames\n */\n constructor(mode?: number, duration?: number, loop?: boolean, framerate?: number, labels?: LabelMap);\n constructor(\n options?: MovieClipOptions | number,\n duration?: number,\n loop?: boolean,\n framerate?: number,\n labels?: LabelMap\n )\n {\n super();\n\n // Default options\n options = options === undefined ? {} : options;\n\n // Options can also be the mode\n if (typeof options === 'number')\n {\n options = {\n mode: options || MovieClip.INDEPENDENT,\n duration: duration || 0,\n loop: loop === undefined ? true : loop,\n labels: labels || {},\n framerate: framerate || 0,\n startPosition: 0,\n };\n }\n else\n {\n // Apply defaults to options\n options = Object.assign({\n mode: MovieClip.INDEPENDENT,\n startPosition: 0,\n loop: true,\n labels: {},\n duration: 0,\n framerate: 0,\n }, options);\n }\n\n this.mode = options.mode;\n this.startPosition = options.startPosition;\n this.loop = !!options.loop;\n this.currentFrame = 0;\n this._labels = [];\n this._labelDict = options.labels;\n\n if (options.labels)\n {\n for (const name in options.labels)\n {\n const label = {\n label: name,\n position: options.labels[name],\n };\n\n this._labels.push(label);\n }\n this._labels.sort((a, b) => a.position - b.position);\n }\n\n this.selfAdvance = true;\n this.paused = false;\n this.actionsEnabled = true;\n this.autoReset = true;\n this._synchOffset = 0;\n this._prevPos = -1; // TODO: evaluate using a ._reset Boolean prop instead of -1.\n this._t = 0;\n this._framerate = options.framerate;\n this._duration = 0;\n this._totalFrames = options.duration;\n this._timelines = [];\n this._timedChildTimelines = [];\n this._depthSorted = [];\n this._actions = [];\n this._beforeUpdate = null;\n this.parentStartPosition = 0;\n\n if (this.mode === MovieClip.INDEPENDENT)\n {\n this._tickListener = this._tickListener.bind(this);\n this._onAdded = this._onAdded.bind(this);\n this._onRemoved = this._onRemoved.bind(this);\n this.on('added', this._onAdded);\n this.on('removed', this._onRemoved);\n }\n\n if (options.framerate)\n {\n this.framerate = options.framerate;\n }\n\n // save often used methods on the instance so that they can be fetched slightly faster\n // than if they had to be fetched from the prototype\n /* eslint-disable no-self-assign */\n this.advance = this.advance;\n this._updateTimeline = this._updateTimeline;\n this._setTimelinePosition = this._setTimelinePosition;\n this._goto = this._goto;\n /* eslint-enable no-self-assign */\n }\n\n private _onAdded(): void\n {\n if (!this._framerate)\n {\n this.framerate = this.parentFramerate;\n }\n SharedTicker.add(this._tickListener, null);\n }\n\n private _tickListener(tickerDeltaTime: number): void\n {\n if (this.paused || !this.selfAdvance)\n {\n // see if the movieclip needs to be updated even though it isn't animating\n if (this._prevPos < 0)\n {\n this._goto(this.currentFrame);\n }\n\n return;\n }\n const seconds = tickerDeltaTime / settings.TARGET_FPMS / 1000;\n\n this.advance(seconds);\n }\n\n private _onRemoved(): void\n {\n SharedTicker.remove(this._tickListener, null);\n }\n\n /**\n * Returns an array of objects with label and position (aka frame) properties, sorted by position.\n */\n public get labels(): FrameLabel[]\n {\n return this._labels;\n }\n\n /**\n * Returns a dictionary of labels where key is the label and value is the frame.\n */\n public get labelsMap(): LabelMap\n {\n return this._labelDict;\n }\n\n /**\n * Returns the name of the label on or immediately before the current frame.\n */\n public get currentLabel(): string | null\n {\n const labels = this._labels;\n let current: string = null;\n\n for (let i = 0, len = labels.length; i < len; ++i)\n {\n if (labels[i].position <= this.currentFrame)\n {\n current = labels[i].label;\n }\n else\n {\n break;\n }\n }\n\n return current;\n }\n\n /**\n * When the MovieClip is framerate independent, this is the time elapsed from frame 0 in seconds.\n */\n public get elapsedTime(): number\n {\n return this._t;\n }\n\n public set elapsedTime(value)\n {\n this._t = value;\n }\n\n /**\n * By default MovieClip instances advance one frame per tick. Specifying a framerate for the\n * MovieClip will cause it to advance based on elapsed time between ticks as appropriate to\n * maintain the target framerate.\n *\n * For example, if a MovieClip with a framerate of 10 is placed on a Stage being updated at\n * 40fps, then the MovieClip advance roughly one frame every 4 ticks. This will not be exact,\n * because the time between each tick vary slightly between frames.\n *\n * This feature is dependent on the tick event object (or an object with an appropriate 'delta' property) being\n * passed into {{#crossLink 'Stage/update'}}{{/crossLink}}.\n */\n public get framerate(): number\n {\n return this._framerate;\n }\n public set framerate(value)\n {\n if (value > 0)\n {\n if (this._framerate)\n {\n // recalculate time based on difference between new and old framerate:\n this._t *= this._framerate / value;\n }\n else\n {\n this._t = this.currentFrame / value;\n }\n this._framerate = value;\n this._duration = value ? this._totalFrames / value : 0;\n }\n else\n {\n this._t = this._framerate = this._duration = 0;\n }\n }\n\n /**\n * Get the total number of frames (duration) of this MovieClip\n */\n public get totalFrames(): number\n {\n return this._totalFrames;\n }\n\n /**\n * Extend the timeline to the last frame.\n */\n private _autoExtend(endFrame: number): void\n {\n if (this._totalFrames < endFrame)\n {\n this._totalFrames = endFrame;\n }\n }\n\n /**\n * Convert values of properties\n */\n private _parseProperties(properties: TweenProps & {t?: string | number; v?: number | boolean}): void\n {\n // Convert any string colors to uints\n if (typeof properties.t === 'string')\n {\n properties.t = utils.hexToUint(properties.t);\n }\n else if (typeof properties.v === 'number')\n {\n properties.v = !!properties.v;\n }\n }\n\n /**\n * Get a timeline for a child, synced timeline.\n */\n private _getChildTimeline(instance: AnimateDisplayObject): Timeline\n {\n for (let i = this._timelines.length - 1; i >= 0; --i)\n {\n if (this._timelines[i].target === instance)\n {\n return this._timelines[i];\n }\n }\n const timeline = Timeline.create(instance);\n\n this._timelines.push(timeline);\n\n return timeline;\n }\n\n /**\n * Add mask or masks\n */\n public addTimedMask(instance: AnimateDisplayObject, keyframes: {[frame: number]: Graphics | Sprite}): this\n {\n for (const i in keyframes)\n {\n this.addKeyframe(instance, {\n m: keyframes[i],\n }, parseInt(i, 10));\n }\n\n // Set the initial position/add\n this._setTimelinePosition(this.currentFrame, this.currentFrame, true);\n\n return this;\n }\n\n /**\n * Shortcut alias for `addTimedMask`\n */\n public am = this.addTimedMask;\n\n /**\n * Shortcut alias for `addTween`\n */\n public tw = this.addTween;\n\n /**\n * Add a tween to the clip\n * @param instance - The clip to tween\n * @param properties - The property or property to tween\n * @param startFrame - The frame to start tweening\n * @param duration - Number of frames to tween. If 0, then the properties are set with no tweening.\n * @param ease - An optional easing function that takes the tween time from 0-1.\n */\n public addTween(instance: AnimateDisplayObject,\n properties: TweenProps,\n startFrame: number,\n duration?: number,\n ease?: EaseMethod): this\n {\n const timeline = this._getChildTimeline(instance);\n\n this._parseProperties(properties);\n timeline.addTween(properties, startFrame, duration, ease);\n this._autoExtend(startFrame + duration);\n\n return this;\n }\n\n /**\n * Add a tween to the clip\n * @param instance - The clip to tween\n * @param properties - The property or property to tween\n * @param startFrame - The frame to start tweening\n */\n public addKeyframe(instance: AnimateDisplayObject, properties: KeyframeData, startFrame: number): this\n {\n const timeline = this._getChildTimeline(instance);\n const { tw } = properties;\n\n // remove tw property just so that it doesn't mess anything up or confuse anyone doing debugging\n delete properties.tw;\n this._parseProperties(properties);\n // add keyframe - note that even if we add a tween immediately afterwards, we want to\n // add this keyframe in order to make sure the starting properties are set\n timeline.addKeyframe(properties, startFrame);\n this._autoExtend(startFrame);\n // Add a tween if present in the keyframe data\n if (tw)\n {\n this.addTween(instance, tw.p, startFrame, tw.d, getEaseFromConfig(tw.e));\n }\n\n return this;\n }\n\n /**\n * Alias for method `addTimedChild`\n */\n public at = this.addTimedChild;\n\n /**\n * Add a child to show for a certain number of frames before automatic removal.\n * @param instance - The clip to show\n * @param startFrame - The starting frame\n * @param duration - The number of frames to display the child before removing it.\n * @param keyframes - The collection of static keyframes to add\n */\n public addTimedChild(instance: AnimateDisplayObject,\n startFrame: number,\n duration?: number,\n keyframes?: string | {[frame: number]: KeyframeData}): this\n {\n if (startFrame === undefined) // jshint ignore:line\n {\n startFrame = 0;\n }\n if (duration === undefined || duration < 1) // jshint ignore:line\n {\n duration = this._totalFrames || 1;\n }\n\n // Add the starting offset for synced movie clips\n if (instance instanceof MovieClip && instance.mode === MovieClip.SYNCHED)\n {\n (instance as MovieClip).parentStartPosition = startFrame;\n }\n\n // add tweening info about this child's presence on stage\n // when the child is (re)added, if it has 'autoReset' set to true, then it\n // should be set back to frame 0\n let timeline: TimedChildTimeline;\n\n // get existing timeline\n for (let i = this._timedChildTimelines.length - 1; i >= 0; --i)\n {\n if (this._timedChildTimelines[i].target === instance)\n {\n timeline = this._timedChildTimelines[i];\n break;\n }\n }\n // if there wasn't one, make a new one\n if (!timeline)\n {\n timeline = [];\n timeline.target = instance;\n this._timedChildTimelines.push(timeline);\n }\n\n // Fill the timeline with keyframe booleans\n utils.fillFrames(timeline, startFrame, duration);\n\n // Update the total frames if the instance extends our current\n // total frames for this movieclip\n if (this._totalFrames < startFrame + duration)\n {\n this._totalFrames = startFrame + duration;\n }\n\n // Add the collection of keyframes\n if (keyframes)\n {\n if (typeof keyframes === 'string')\n {\n keyframes = utils.deserializeKeyframes(keyframes);\n }\n let sequenceUsesSkew = false;\n\n for (const i in keyframes)\n {\n if (keyframes[i].kx || keyframes[i].ky)\n {\n sequenceUsesSkew = true;\n break;\n }\n }\n if (sequenceUsesSkew)\n {\n for (const i in keyframes)\n {\n if (keyframes[i].r !== undefined)\n {\n keyframes[i].kx = keyframes[i].kx || keyframes[i].r * -1;\n keyframes[i].ky = keyframes[i].ky || keyframes[i].r;\n delete keyframes[i].r;\n }\n if (keyframes[i].tw?.p?.r !== undefined)\n {\n keyframes[i].tw.p.kx = keyframes[i].tw.p.kx || keyframes[i].tw.p.r * -1;\n keyframes[i].tw.p.ky = keyframes[i].tw.p.ky || keyframes[i].tw.p.r;\n delete keyframes[i].tw.p.r;\n }\n }\n }\n for (const i in keyframes)\n {\n this.addKeyframe(instance, keyframes[i], parseInt(i, 10));\n }\n this._getChildTimeline(instance)\n // subtract 1 from duration because we are using 0 based frame indices\n // and duration is calculated as total frames\n .extendLastFrame(startFrame + duration - 1);\n }\n\n // Set the initial position/add\n this._setTimelinePosition(startFrame, this.currentFrame, true);\n\n return this;\n }\n\n /**\n * Short cut for `addAction`\n */\n public aa = this.addAction;\n\n /**\n * Handle frame actions, callback is bound to the instance of the MovieClip.\n * @param callback - The clip call on a certain frame\n * @param startFrame - The starting frame index or label\n */\n public addAction(callback: FrameAction, startFrame: number | string): this\n {\n if (typeof startFrame === 'string')\n {\n const index = this._labelDict[startFrame];\n\n if (index === undefined)\n {\n throw new Error(`The label '${startFrame}' does not exist on this timeline`);\n }\n startFrame = index;\n }\n\n const actions = this._actions;\n\n // ensure that the movieclip timeline is long enough to support the target frame\n if (actions.length <= startFrame)\n {\n actions.length = startFrame + 1;\n }\n if (this._totalFrames < startFrame)\n {\n this._totalFrames = startFrame;\n }\n // add the action\n if (actions[startFrame])\n {\n actions[startFrame].push(callback);\n }\n else\n {\n actions[startFrame] = [callback];\n }\n\n return this;\n }\n\n /**\n * Short cut for `playSound`\n */\n public ps = this.playSound;\n\n /**\n * Handle sounds.\n * @param alias - The name of the Sound\n * @param loop - The loop property of the sound\n */\n public playSound(alias: string, loop?: boolean): this\n {\n sound.emit('play', alias, !!loop, this);\n\n return this;\n }\n\n /**\n * Sets paused to false.\n */\n play(): void\n {\n this.paused = false;\n }\n\n /**\n * Sets paused to true.\n */\n stop(): void\n {\n this.paused = true;\n }\n\n /**\n * Advances this movie clip to the specified position or label and sets paused to false.\n * @param positionOrLabel - The animation name or frame number to go to.\n */\n public gotoAndPlay(positionOrLabel: string | number): void\n {\n this.paused = false;\n this._goto(positionOrLabel);\n }\n\n /**\n * Advances this movie clip to the specified position or label and sets paused to true.\n * @param positionOrLabel - The animation or frame name to go to.\n */\n public gotoAndStop(positionOrLabel: string | number): void\n {\n this.paused = true;\n this._goto(positionOrLabel);\n }\n\n /**\n * Get the close parent with a valid framerate. If no parent, returns the default framerate.\n */\n public get parentFramerate(): number\n {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n let o: MovieClip = this;\n let fps = o._framerate;\n\n // eslint-disable-next-line no-unmodified-loop-condition\n while ((o = o.parent as MovieClip) && !fps)\n {\n if (o.mode === MovieClip.INDEPENDENT)\n {\n fps = o._framerate;\n }\n }\n\n return fps || MovieClip.DEFAULT_FRAMERATE;\n }\n\n /**\n * Advances the playhead. This occurs automatically each tick by default.\n * @param time - The amount of time in seconds to advance by. Only applicable if framerate is set.\n */\n public advance(time?: number): void\n {\n // Handle any other cases where starting to play\n // and no framerate has been set yet\n if (!this._framerate)\n {\n this.framerate = this.parentFramerate;\n }\n\n if (time)\n {\n this._t += time;\n }\n if (this._t > this._duration)\n {\n this._t = this.loop ? this._t % this._duration : this._duration;\n }\n // add a tiny amount to account for potential floating point errors\n this.currentFrame = Math.floor((this._t * this._framerate) + 0.00000001);\n // final error checking\n if (this.currentFrame >= this._totalFrames)\n {\n this.currentFrame = this._totalFrames - 1;\n }\n let afterUpdateOnce;\n\n if (this._beforeUpdate)\n {\n afterUpdateOnce = this._beforeUpdate(this);\n }\n // update all tweens & actions in the timeline\n this._updateTimeline();\n\n // Do the animator callback here\n if (afterUpdateOnce)\n {\n afterUpdateOnce();\n }\n }\n\n /**\n * @param positionOrLabel - The animation name or frame number to go to.\n */\n protected _goto(positionOrLabel: string | number): void\n {\n const pos = typeof positionOrLabel === 'string' ? this._labelDict[positionOrLabel] : positionOrLabel;\n\n if (pos === undefined) // jshint ignore:line\n {\n return;\n }\n // prevent _updateTimeline from overwriting the new position because of a reset:\n this._prevPos = NaN;\n this.currentFrame = pos;\n\n // Handle the case where trying to play but haven't\n // added to the stage yet\n if (!this._framerate)\n {\n this.framerate = this.parentFramerate;\n }\n\n // update the elapsed time if a time based movieclip\n if (this._framerate > 0)\n {\n this._t = pos / this._framerate;\n }\n else\n {\n this._t = 0;\n }\n this._updateTimeline();\n }\n\n /**\n * Reset the movieclip to the first frame (without advancing the timeline).\n */\n private _reset(): void\n {\n this._prevPos = -1;\n this._t = 0;\n this.currentFrame = 0;\n }\n\n /**\n * Update timeline position according to playback, performing actions and updating children.\n * @private\n */\n public _updateTimeline(): void\n {\n const synched = this.mode !== MovieClip.INDEPENDENT;\n\n if (synched)\n {\n this.currentFrame = this.startPosition + (this.mode === MovieClip.SINGLE_FRAME ? 0 : this._synchOffset);\n if (this.currentFrame >= this._totalFrames)\n {\n this.currentFrame %= this._totalFrames;\n }\n }\n\n if (this._prevPos === this.currentFrame)\n {\n return;\n }\n\n // update timeline position, ignoring actions if this is a graphic.\n this._setTimelinePosition(this._prevPos, this.currentFrame, synched ? false : this.actionsEnabled);\n\n this._prevPos = this.currentFrame;\n }\n\n /**\n * Set the timeline position\n */\n protected _setTimelinePosition(startFrame: number, currentFrame: number, doActions: boolean): void\n {\n if (startFrame !== currentFrame && doActions)\n {\n let startPos: number;\n\n if (isNaN(startFrame))\n {\n startPos = currentFrame;\n }\n else\n {\n startPos = (startFrame >= this._totalFrames - 1 ? 0 : startFrame + 1);\n }\n // generate actionFrames on the way\n const actionFrames: number[] = [];\n\n // loop\n if (currentFrame < startPos)\n {\n for (let i = startPos; i < this._actions.length; ++i)\n {\n if (this._actions[i])\n {\n actionFrames.push(i);\n }\n }\n for (let i = 0; i <= currentFrame; ++i)\n {\n if (this._actions[i])\n {\n actionFrames.push(i);\n }\n }\n }\n // no loop\n else\n {\n for (let i = startPos; i <= currentFrame; ++i)\n {\n if (this._actions[i])\n {\n actionFrames.push(i);\n }\n }\n }\n\n if (actionFrames.length)\n {\n const oldCurrentFrame = this.currentFrame;\n\n for (let i = 0; i < actionFrames.length; ++i)\n {\n const frame = actionFrames[i];\n\n this._setTimelinePosition(frame, frame, true);\n // _goto is called OR last frame reached\n if (this.currentFrame !== oldCurrentFrame || frame === currentFrame)\n {\n return;\n }\n // stop is called\n else if (this.paused)\n {\n this.currentFrame = frame;\n\n return;\n }\n }\n }\n }\n\n // handle all tweens\n const _timelines = this._timelines;\n\n for (let i = _timelines.length - 1; i >= 0; --i)\n {\n const timeline = _timelines[i];\n\n for (let j = 0, length = timeline.length; j < length; ++j)\n {\n const tween = timeline[j];\n\n // if the tween contains part of the timeline that we are travelling through\n if (currentFrame >= tween.startFrame && currentFrame <= tween.endFrame)\n {\n // set the position within that tween\n // and break the loop to move onto the next timeline\n tween.setPosition(currentFrame);\n break;\n }\n }\n }\n\n const timedChildTimelines = this._timedChildTimelines;\n const depthSorted = this._depthSorted;\n\n for (let i = 0, length = timedChildTimelines.length; i < length; ++i)\n {\n const target = timedChildTimelines[i].target;\n const shouldBeChild = timedChildTimelines[i][currentFrame];\n\n // if child should be on stage and is not:\n if (shouldBeChild)\n {\n // Add to the depthSorted object so we can\n // check that items are property drawn later\n depthSorted.push(target);\n if (target.parent !== this)\n {\n // add the target if it's not there already\n this.addChild(target);\n if (target instanceof MovieClip && target.mode === MovieClip.INDEPENDENT && target.autoReset)\n {\n target._reset();\n }\n }\n }\n else if (!shouldBeChild && target.parent === this)\n {\n this.removeChild(target);\n }\n }\n\n // Properly depth sort the children\n for (let i = 0, length = depthSorted.length; i < length; i++)\n {\n const target = depthSorted[i];\n const currentIndex = this.children.indexOf(target);\n\n if (currentIndex !== i)\n {\n this.addChildAt(target, i);\n }\n }\n\n // Clear the temporary depth sorting array\n depthSorted.length = 0;\n\n // go through all children and update synched movieclips that are not single frames\n const children = this.children;\n\n for (let i = 0, length = children.length; i < length; ++i)\n {\n const child = children[i];\n\n if (child instanceof MovieClip && child.mode === MovieClip.SYNCHED)\n {\n child._synchOffset = currentFrame - child.parentStartPosition;\n child._updateTimeline();\n }\n }\n\n // handle actions\n if (doActions && this._actions && this._actions[currentFrame])\n {\n const frameActions = this._actions[currentFrame];\n\n for (let j = 0; j < frameActions.length; ++j)\n {\n frameActions[j].call(this);\n }\n }\n }\n\n destroy(options?: IDestroyOptions | boolean): void\n {\n if (this._tickListener)\n {\n SharedTicker.remove(this._tickListener, null);\n this._tickListener = null;\n }\n const hiddenChildren = [];\n const timelines = this._timelines;\n\n if (timelines)\n {\n for (let i = 0; i < timelines.length; i++)\n {\n const timeline = timelines[i];\n\n hiddenChildren.push(timeline.target);\n timeline.destroy();\n }\n }\n const childTimelines = this._timedChildTimelines;\n\n if (childTimelines)\n {\n for (let i = 0; i < childTimelines.length; i++)\n {\n const timeline = childTimelines[i];\n\n if (hiddenChildren.indexOf(timeline.target) < 0)\n {\n hiddenChildren.push(timeline.target);\n }\n timeline.length = 0;\n }\n }\n // Destroy all the children\n for (let i = 0; i < hiddenChildren.length; i++)\n {\n // Don't destroy children in the display list\n if (this.children.indexOf(hiddenChildren[i]) < 0)\n {\n hiddenChildren[i].destroy(options as IDestroyOptions);\n }\n }\n hiddenChildren.length = 0;\n this._actions = null;\n this._timelines = null;\n this._depthSorted = null;\n this._timedChildTimelines = null;\n this._beforeUpdate = null;\n this._labels = null;\n this._labelDict = null;\n super.destroy(options as IDestroyOptions);\n }\n}\n"],"names":[],"mappings":";;;;;;;;AAWA,MAAM,eAAe,MAAO,CAAA,MAAA,CAAA;AAgDrB,MAAM,UAAA,GAAN,cAAwB,gBAC/B,CAAA;AAAA,EAwKI,WACI,CAAA,OAAA,EACA,QACA,EAAA,IAAA,EACA,WACA,MAEJ,EAAA;AACI,IAAM,KAAA,EAAA,CAAA;AArJV;AAAA;AAAA;AAAA;AAAA,IAAA,IAAA,CAAO,WAAc,GAAA,IAAA,CAAA;AAqbrB;AAAA;AAA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