UNPKG

@flashport/flashport

Version:

FlashPort is a TypeScript 2D graphics library that largely replicates the Flash ActionScript 3.0 library

242 lines (241 loc) 9.64 kB
import { Sprite } from "./Sprite"; import { DisplayObject } from "./DisplayObject"; import { Scene } from "./Scene"; export declare class MovieClip extends Sprite { private _currentFrame; private _currentKeyFrame; private _currentFrameLabel; private _currentLabel; private _currentLabels; private _currentScene; private _enabled; private _framesLoaded; private _isPlaying; private _scenes; private _totalFrames; private _trackAsMenu; private _keyframes; private _tweens; private _tweenEnds; private _frame; private _keyList; private _layerList; private _prevKeyframe; private _frameScripts; private _frameSounds; private _playingSounds; /** * Animate Method Only */ addLabels: (frameLabels: Array<any>) => void; /** * Animate Method Only */ addFrameObjects: (frame: number, frameEnd: number, layer: number, frameObjects: any[]) => void; /** * Animate Method Only */ addFrameTween: (start: number, end: number, obj: DisplayObject, props: any) => void; private navigate; private updateTweens; /** * Animate Only * @param id * @param frame * @param envelops */ _addSnd: (id: string, start: number, end: number, frame: number, envelops: any[]) => void; /** * Specifies the number of the frame in which the playhead is located in the timeline of * the MovieClip instance. If the movie clip has multiple scenes, this value is the * frame number in the current scene. * @langversion 3.0 * @playerversion Flash 9 * @playerversion Lite 4 */ get currentFrame(): number; /** * The label at the current frame in the timeline of the MovieClip instance. * If the current frame has no label, currentLabel is null. * @langversion 3.0 * @playerversion Flash 10 * @playerversion AIR 1.5 * @playerversion Lite 4 */ get currentFrameLabel(): string; /** * The current label in which the playhead is located in the timeline of the MovieClip instance. * If the current frame has no label, currentLabel is set to the name of the previous frame * that includes a label. If the current frame and previous frames do not include a label, * currentLabel returns null. * @langversion 3.0 * @playerversion Flash 9 * @playerversion Lite 4 */ get currentLabel(): string; /** * Returns an array of FrameLabel objects from the current scene. If the MovieClip instance does * not use scenes, the array includes all frame labels from the entire MovieClip instance. * @langversion 3.0 * @playerversion Flash 9 * @playerversion Lite 4 */ get currentLabels(): any[]; /** * The current scene in which the playhead is located in the timeline of the MovieClip instance. * @langversion 3.0 * @playerversion Flash 9 * @playerversion Lite 4 */ get currentScene(): Scene; /** * A Boolean value that indicates whether a movie clip is enabled. The default value of enabled * is true. If enabled is set to false, the movie clip's * Over, Down, and Up frames are disabled. The movie clip * continues to receive events (for example, mouseDown, * mouseUp, keyDown, and keyUp). * * The enabled property governs only the button-like properties of a movie clip. You * can change the enabled property at any time; the modified movie clip is immediately * enabled or disabled. If enabled is set to false, the object is not * included in automatic tab ordering. * @langversion 3.0 * @playerversion Flash 9 * @playerversion Lite 4 */ get enabled(): boolean; set enabled(value: boolean); /** * The number of frames that are loaded from a streaming SWF file. You can use the framesLoaded * property to determine whether the contents of a specific frame and all the frames before it * loaded and are available locally in the browser. You can also use it to monitor the downloading * of large SWF files. For example, you might want to display a message to users indicating that * the SWF file is loading until a specified frame in the SWF file finishes loading. * * If the movie clip contains multiple scenes, the framesLoaded property returns the number * of frames loaded for all scenes in the movie clip. * @langversion 3.0 * @playerversion Flash 9 * @playerversion Lite 4 */ get framesLoaded(): number; get isPlaying(): boolean; /** * An array of Scene objects, each listing the name, the number of frames, * and the frame labels for a scene in the MovieClip instance. * @langversion 3.0 * @playerversion Flash 9 * @playerversion Lite 4 */ get scenes(): any[]; /** * The total number of frames in the MovieClip instance. * * If the movie clip contains multiple frames, the totalFrames property returns * the total number of frames in all scenes in the movie clip. * @langversion 3.0 * @playerversion Flash 9 * @playerversion Lite 4 */ get totalFrames(): number; /** * Indicates whether other display objects that are SimpleButton or MovieClip objects can receive * mouse release events or other user input release events. The trackAsMenu property lets you create menus. You * can set the trackAsMenu property on any SimpleButton or MovieClip object. * The default value of the trackAsMenu property is false. * * You can change the trackAsMenu property at any time; the modified movie * clip immediately uses the new behavior. * @langversion 3.0 * @playerversion Flash 9 */ get trackAsMenu(): boolean; set trackAsMenu(value: boolean); addFrameScript: (frame: number, func: Function) => void; /** * Starts playing the SWF file at the specified frame. This happens after all * remaining actions in the frame have finished executing. To specify a scene * as well as a frame, specify a value for the scene parameter. * @param frame A number representing the frame number, or a string representing the label of the * frame, to which the playhead is sent. If you specify a number, it is relative to the * scene you specify. If you do not specify a scene, the current scene determines the global frame number to play. If you do specify a scene, the playhead * jumps to the frame number in the specified scene. * @param scene The name of the scene to play. This parameter is optional. * @langversion 3.0 * @playerversion Flash 9 * @playerversion Lite 4 */ gotoAndPlay: (frame: any, scene?: string) => void; /** * Brings the playhead to the specified frame of the movie clip and stops it there. This happens after all * remaining actions in the frame have finished executing. If you want to specify a scene in addition to a frame, * specify a scene parameter. * @param frame A number representing the frame number, or a string representing the label of the * frame, to which the playhead is sent. If you specify a number, it is relative to the * scene you specify. If you do not specify a scene, the current scene determines the global frame number at which to go to and stop. If you do specify a scene, * the playhead goes to the frame number in the specified scene and stops. * @param scene The name of the scene. This parameter is optional. * @langversion 3.0 * @playerversion Flash 9 * @playerversion Lite 4 * @throws ArgumentError If the scene or frame specified are * not found in this movie clip. */ gotoAndStop: (frame: any, scene?: string) => void; /** * Creates a new MovieClip instance. After creating the MovieClip, call the * addChild() or addChildAt() method of a * display object container that is onstage. * @langversion 3.0 * @playerversion Flash 9 * @playerversion Lite 4 */ constructor(); /** * Sends the playhead to the next frame and stops it. This happens after all * remaining actions in the frame have finished executing. * @langversion 3.0 * @playerversion Flash 9 * @playerversion Lite 4 */ nextFrame: () => void; /** * Moves the playhead to the next scene of the MovieClip instance. This happens after all * remaining actions in the frame have finished executing. * @langversion 3.0 * @playerversion Flash 9 * @playerversion Lite 4 */ nextScene: () => void; /** * Moves the playhead in the timeline of the movie clip. * @langversion 3.0 * @playerversion Flash 9 * @playerversion Lite 4 */ play: () => void; /** * Sends the playhead to the previous frame and stops it. This happens after all * remaining actions in the frame have finished executing. * @langversion 3.0 * @playerversion Flash 9 * @playerversion Lite 4 */ prevFrame: () => void; /** * Moves the playhead to the previous scene of the MovieClip instance. This happens after all * remaining actions in the frame have finished executing. * @langversion 3.0 * @playerversion Flash 9 * @playerversion Lite 4 */ prevScene: () => void; /** * Stops the playhead in the movie clip. * @langversion 3.0 * @playerversion Flash 9 * @playerversion Lite 4 */ stop: () => void; private onFrameEvent; }