import { Bounds } from "@awayjs/graphics"; import { DisplayObject, IAdvancable, DisplayObjectFlags, HitTestingType, HitTestingResult } from "./DisplayObject"; import { ASFunction } from '../../avm2/nat/ASFunction'; import { SWFFrame } from '../../../parsers/SWFFrame'; /** * 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. */ /** * AVM1Movie is the reflection of AVM1 SWFs loaded into AVM2 content. Since AVM1 content is * completely opaque to AVM2 content, it's not a DisplayObjectContainer, even though it contains * nested children. This is because the two worlds are completely separated from each other[1], and * each AVM1 SWF is entirely isolated from everything else. * * This causes a few headaches because we implement the AVM1 display list in terms of the AVM2 * display list: each AVM1 MovieClip is a wrapper around an AVM2 MovieClip instance, which is * what's actually on stage. Theoretically, the top-most AVM2 MovieClip for an AVM1 SWF isn't * supposed to have a parent. However, we need it to be part of the stage's display tree in order * to take part in rendering. * * Therefore, the AVM2 MovieClip wrapped by an AVM1Movie gets the latter set as its parent, even * though AVM1Movie isn't a DisplayObjectContainer. We borrow methods from that and generally * pretend that AVM1Movie is a container in some places to pull that off. * * [1]: If you ignore the undocumented `call` and `addCallback` methods for a moment. */ export declare class AVM1Movie extends DisplayObject implements IAdvancable { static classInitializer: any; static classSymbols: string[]; static instanceSymbols: string[]; constructor(level0: DisplayObject); private _content; private _constructed; call(functionName: string): any; addCallback(functionName: string, closure: ASFunction): void; _addFrame(frame: SWFFrame): void; _initFrame(advance: boolean): void; _constructFrame(): void; _enqueueFrameScripts(): void; _propagateFlagsDown(flags: DisplayObjectFlags): void; /** * AVM1Movie only takes the AVM1 content into consideration when testing points against * bounding boxes, not otherwise. */ _containsPoint(globalX: number, globalY: number, localX: number, localY: number, testingType: HitTestingType, objects: DisplayObject[]): HitTestingResult; /** * Override of DisplayObject#_getChildBounds that retrieves the AVM1 content's bounds. */ _getChildBounds(bounds: Bounds, includeStrokes: boolean): void; _getLevelForRoot(root: DisplayObject): number; _getRootForLevel(level: number): DisplayObject; _addRoot(level: number, root: DisplayObject): void; _removeRoot(level: number): boolean; }