import { HitTestingResult, IAdvancable, DisplayObject, HitTestingType } from "./DisplayObject"; import { Sprite } from "./Sprite"; import { Scene } from "./Scene"; import { ASArray } from "../../avm2/nat/ASArray"; import { FrameLabel } from "./FrameLabel"; import { AXClass } from '../../avm2/run/AXClass'; /** * Copyright 2014 Mozilla Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * Controls how to behave on inter-frame navigation. */ export declare const enum FrameNavigationModel { SWF1 = 1, SWF9 = 9, SWF10 = 10 } export interface FrameScript { (any?: any): any; precedence?: number[]; context?: MovieClip; } export declare class MovieClip extends Sprite implements IAdvancable { static frameNavigationModel: FrameNavigationModel; static axClass: typeof MovieClip & AXClass; private static _callQueue; static classInitializer(): void; static reset(): void; static classSymbols: string[]; static instanceSymbols: string[]; static runFrameScripts(): void; static runAvm1FrameScripts(): void; applySymbol(): void; private _initAvm1Data; private _initAvm1FrameData; private _addAvm1FrameScripts; /** * AVM1 InitActionBlocks are executed once, before the children are initialized for a frame. * That matches AS3's enterFrame event, so we can add an event listener that just bails * as long as the target frame isn't reached, and executes the InitActionBlock once it is. * * After that, the listener removes itself. */ private _addAvm1InitActionBlocks; /** * Field holding the as2 object associated with this MovieClip instance. * * This field is only ever populated by the AVM1 runtime, so can only be used for MovieClips * used in the implementation of an AVM1 display list. */ private _as2Object; removeChildAt(index: number): DisplayObject; constructor(); protected _initializeFields(): void; _addFrame(frameInfo: any): void; _initFrame(advance: boolean): void; _constructFrame(): void; _enqueueFrameScripts(): void; private _currentFrame; private _nextFrame; private _totalFrames; private _frames; private _frameScripts; private _scenes; private _enabled; private _isPlaying; private _stopped; private _trackAsMenu; private _allowFrameNavigation; private _sounds; private _buttonFrames; private _currentButtonState; get currentFrame(): number; get framesLoaded(): number; get totalFrames(): number; get trackAsMenu(): boolean; set trackAsMenu(value: boolean); get scenes(): ASArray; get currentScene(): Scene; get currentLabel(): string; get currentLabels(): { value: FrameLabel[]; }; get currentFrameLabel(): string; get enabled(): boolean; set enabled(value: boolean); get isPlaying(): boolean; play(): void; stop(): void; /** * Resolves frame and scene into absolute frame number. If scene is not specified, * the current scene is used. In legacy mode, it might return `undefined` if frame/scene * was not found. */ _getAbsFrameNumber(frame: string, sceneName: string): number; /** * Implementation for both gotoAndPlay and gotoAndStop. * * Technically, we should throw all errors from those functions directly so the stack is * correct. * We might at some point do that by explicitly inlining this function using some build step. */ private _gotoFrame; private _gotoFrameAbs; private _advanceFrame; private _seekToFrame; /** * Because that's how it's mostly used, the current frame is stored as an offset into the * entire timeline. Sometimes, we need to know which scene it falls into. This utility * function answers that. */ private _sceneForFrameIndex; /** * Frame indices are stored as offsets into the entire timline, whereas labels are stored * in their scenes. This utility function iterates over scenes and their labels to find * the label clostest to, but not after the target frame. */ private _labelForFrame; callFrame(frame: number): void; queueAvm1FrameScripts(frame: number, queue: Array): void; nextFrame(): void; prevFrame(): void; gotoAndPlay(frame: any, scene?: string): void; gotoAndStop(frame: any, scene?: string): void; /** * Takes pairs of `frameIndex`, `script` arguments and adds the `script`s to the `_frameScripts` * Array. * * Undocumented method used to implement the old timeline concept in AS3. */ addFrameScript(frameIndex: number, script: FrameScript): void; get _isFullyLoaded(): boolean; _registerStartSounds(frameNum: number, soundStartInfo: any): void; _initSoundStream(streamInfo: any): void; _addSoundStreamBlock(frameNum: number, streamBlock: any): void; private _syncSounds; addScene(name: string, labels_: FrameLabel[], offset: number, numFrames: number): void; addFrameLabel(name: string, frame: number): void; prevScene(): void; nextScene(): void; _containsPointImpl(globalX: number, globalY: number, localX: number, localY: number, testingType: HitTestingType, objects: DisplayObject[], skipBoundsCheck: boolean): HitTestingResult; }