Package | impression.simulation |
Interface | public interface ISimulation extends flash.events.IEventDispatcher |
Note that ISimulation does not specify a user interface for the simulation; this is the responsibility of the ISimulationUI interface.
Property | Defined By | ||
---|---|---|---|
ownerSetsData : Boolean [read-only]
Determines how data is set. | ISimulation |
Method | Defined By | ||
---|---|---|---|
getData(items:* = null):*
Returns specific simulation data. | ISimulation | ||
setData(items:*):void
Sets simulation data. | ISimulation |
Event | Summary | Defined By | ||
---|---|---|---|---|
Dispatch when simulation data has changed. | ISimulation | |||
Dispatch when an error occurs. | ISimulation |
ownerSetsData | property |
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.
public function get ownerSetsData():Boolean
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.
|
* — 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.
|
simulationDataChange | Event |
impression.events.SimulationDataChangedEvent
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:Property | Value |
---|---|
bubbles | false |
cancelable | false ; there is no default behavior to cancel. |
currentTarget | The object that is actively processing the Event object with an event listener. |
target | The object that raised the event. |
changeData | The data that has changed. |
simulationObjectError | Event |
impression.events.SimulationObjectErrorEvent
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:Property | Value |
---|---|
bubbles | false |
cancelable | false ; there is no default behavior to cancel. |
currentTarget | The object that is actively processing the Event object with an event listener. |
target | The object that raised the event. |
sb | The Storyboard object assigned to the target. |
loading | Indicates whether or not the event occurred during the loading phase of the storyboard. |
message | The message associated with the error. |
errorData | Additional data associated with the error. |
source | The type of object that initially raised the error. |