Class: FlashStage

FlashStage(opts, wmodeopt, swfPath)

A Stage implementation using Flash.

Constructor

new FlashStage(opts, wmodeopt, swfPath)

Parameters:
Name Type Attributes Default Description
opts Object
wmode String <optional>
'transparent'

Flash wmode property. Read this for more information.

swfPath String

Path to the SWF file. By default, the SWF is assumed to be named marzipano.swf and located in the same directory as marzipano.js.

Extends

Methods

addLayer(layer)

Add a Layer into the stage.

Parameters:
Name Type Description
layer Layer
Inherited From:
Throws:

Throws an error if the layer already belongs to the stage.

createTexture(tile, asset, done)

Create a texture for the given tile and asset. Called by TextureStore.

Parameters:
Name Type Description
tile Tile
asset Asset
done function
Inherited From:

destroy()

Destructor.

Overrides:

domElement() → {HTMLElement}

Inherited From:
Returns:

DOM element where layers are rendered

Type
HTMLElement

hasLayer(layer) → {boolean}

Return whether the stage contains a Layer.

Parameters:
Name Type Description
layer Layer
Inherited From:
Returns:
Type
boolean

height() → {number}

Get the stage height.

Inherited From:
Returns:
Type
number

listLayers() → {Array.<Layer>}

Return a list of all layers contained in the stage.

Inherited From:
Returns:
Type
Array.<Layer>

moveLayer(layer, i)

Move a Layer to the given position in the stack.

Parameters:
Name Type Description
layer Layer
i Number
Inherited From:
Throws:

Throws an error if the layer does not belong to the stage or the new position is invalid.

removeAllLayers()

Remove all layers from the stage.

Inherited From:

removeLayer(layer)

Remove a Layer from the stage.

Parameters:
Name Type Description
layer Layer
Inherited From:
Throws:

Throws an error if the layer does not belong to the stage.

render()

Render the current frame. Usually called from a RenderLoop.

This contains the rendering logic common to all stage types. Subclasses define the startFrame() and endFrame() methods to perform their own logic.

Inherited From:

setSize(obj)

Set the stage dimensions.

This contains the size update logic common to all stage types. Subclasses define the _setSize() method to perform their own logic, if required.

Parameters:
Name Type Description
obj Object
Properties
Name Type Description
width number
height number
Inherited From:

size(obj)

Get the stage dimensions. If an object argument is supplied, the object is filled in with the result and returned. Otherwise, a fresh object is returned.

Parameters:
Name Type Description
obj Object
Properties
Name Type Description
width number
height number
Inherited From:

width() → {number}

Get the stage width.

Inherited From:
Returns:
Type
number