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

ISimulation defines the minimum functionality required for a simulation object.

Note that ISimulation does not specify a user interface for the simulation; this is the responsibility of the ISimulationUI interface.



Public Properties
 PropertyDefined By
  ownerSetsData : Boolean
[read-only] Determines how data is set.
ISimulation
Public Methods
 MethodDefined By
  
getData(items:* = null):*
Returns specific simulation data.
ISimulation
  
setData(items:*):void
Sets simulation data.
ISimulation
Events
 Event Summary Defined By
  Dispatch when simulation data has changed.ISimulation
  Dispatch when an error occurs.ISimulation
Property Detail
ownerSetsDataproperty
ownerSetsData:Boolean  [read-only]

Determines how data is set.

If this property value is true, it is the responsibility of the simulation owner to set data values when the simulation user interface makes an (approved) change. If this property value is false, the SimulationPlayer class will call the setData() method when the simulation user interface makes an approved change.

If your simulation and simulation user interface are contained within the same .SWF file, and can run as a standalone freeplay simulation, return true. If your simulation and simulation user interface are contained in separate files, or the simulation cannot run with the SimulationPlayer, return false.

If your simulation can run standalone (and this property value is false), ensure that you have a mechanism in place to allow the SimulationPlayer to cancel the proposed changes from the user interface. The MagicBox sample simulation included in the AS3 RTE DevKit shows one way to accomplish this.


Implementation
    public function get ownerSetsData():Boolean
Method Detail
getData()method
public function getData(items:* = null):*

Returns specific simulation data. The specific format of the items parameter and the return value are simulation-specific.

Parameters

items:* (default = null) — An expression specifying the data to return.

Returns
* — The data specified by items.
setData()method 
public function setData(items:*):void

Sets simulation data. The specific format of the items parameter is simulation-specific.

Parameters

items:* — An expression specifying the data to set.

Event Detail
simulationDataChange Event
Event Object Type: impression.events.SimulationDataChangedEvent
SimulationDataChangedEvent.type property = impression.events.SimulationDataChangedEvent.DATA_CHANGE

Dispatch when simulation data has changed.

The SimulationDataChangedEvent.DATA_CHANGE constant defines the value of the type property of a data change 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.
changeDataThe data that has changed.
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.