Packageimpression.simulation
Interfacepublic interface ISnapshotLoader extends flash.events.IEventDispatcher

ISnapshotLoader defines the minimum functionality required by the SimulationPlayer for an object that processes snapshots.

A snapshot is defined as an external file that contains data specifying a specific simulation state. In some cases, supporting snapshot capabilities can improve the time it takes to set the simulation for a specific storyboard, particularly when compared to sequencing. Snapshots can also be reused, improving the efficiency of the content development process. Note that the data format of this file, the methodology used by an implementer to process the snapshot, and any functionality provided by the simulation to support processing snapshots, is simulation-specific. Although it is possible to build a "generic" snapshot loader that can work with simulation objects that implement one of the ISnapshot[String,XML]Reader interfaces, typical ISnapshotLoader implementations are created for a specific simulation.



Public Methods
 MethodDefined By
  
cancel():void
Cancels any snapshot processing currently in progress.
ISnapshotLoader
  
loadSnapshot(simulation:ISimulation, snapshot:AssetData, resolver:AssetResolver, resolverOwner:*):void
Loads the simulation with the snapshot data.
ISnapshotLoader
Events
 Event Summary Defined By
  Dispatch when snapshot processing has completed.ISnapshotLoader
  Dispatch when an error occurs.ISnapshotLoader
Method Detail
cancel()method
public function cancel():void

Cancels any snapshot processing currently in progress.

loadSnapshot()method 
public function loadSnapshot(simulation:ISimulation, snapshot:AssetData, resolver:AssetResolver, resolverOwner:*):void

Loads the simulation with the snapshot data. Implementers must dispatch the SimulationObjectEvent.INITIALIZATION_COMPLETE event when snapshot processing has completed.

Parameters

simulation:ISimulation — The simulation to load with snapshot data.
 
snapshot:AssetData — The snapshot file to load.
 
resolver:AssetResolver — The AssetResolver to use to load the snapshot file.
 
resolverOwner:* — The owner to use when loading the snapshot file.

Event Detail
initializationComplete Event
Event Object Type: impression.events.SimulationObjectEvent
SimulationObjectEvent.type property = impression.events.SimulationObjectEvent.INITIALIZATION_COMPLETE

Dispatch when snapshot processing has completed.

The SimulationObjectEvent.INITIALIZATION_COMPLETE constant defines the value of the type property of a simulation object initialization complete event object. This event has the following properties:
PropertyValue
bubblesfalse
cancelablefalse; there is no default behavior to cancel.
currentTargetThe object that is actively processing the Event object with an event listener.
targetThe object that raised the event.
simulationObjectError Event  
Event Object Type: impression.events.SimulationObjectErrorEvent
SimulationObjectErrorEvent.type property = impression.events.SimulationPlayerErrorEvent.ERROR

Dispatch when an error occurs.

The SimulationPlayerErrorEvent.ERROR constant defines the value of the type property of an error event object. This event has the following properties:
PropertyValue
bubblesfalse
cancelablefalse; there is no default behavior to cancel.
currentTargetThe object that is actively processing the Event object with an event listener.
targetThe object that raised the event.
sbThe Storyboard object assigned to the target.
loadingIndicates whether or not the event occurred during the loading phase of the storyboard.
messageThe message associated with the error.
errorDataAdditional data associated with the error.
sourceThe type of object that initially raised the error.