Impression AS3 BCF Documentation | All Packages | All Classes | Index | Frames | ![]() |
ISimulationUI | Properties | Methods | Events | |
Package | impression.simulation |
Interface | public interface ISimulationUI extends flash.events.IEventDispatcher |
Property | Defined By | ||
---|---|---|---|
displayObject : DisplayObject [read-only]
Returns the display object representing the user interface. | ISimulationUI | ||
ownerGetsData : Boolean [read-only]
Determines how requests for simulation data are handled. | ISimulationUI |
Method | Defined By | ||
---|---|---|---|
onSimulationDataChanged(simulation:ISimulation, changeData:*):void
Invoked when simulation data has changed. | ISimulationUI |
Event | Summary | Defined By | ||
---|---|---|---|---|
Dispatch when the user interface wants to change the simulation state. | ISimulationUI | |||
Dispatch when the user interface needs simulation data. | ISimulationUI | |||
Dispatch when an error occurs. | ISimulationUI |
displayObject | property |
displayObject:DisplayObject
[read-only] Returns the display object representing the user interface.
public function get displayObject():DisplayObject
ownerGetsData | property |
ownerGetsData:Boolean
[read-only] Determines how requests for simulation data are handled.
If this property value is true
, it is the responsibility of the simulation owner to get data values
when this object dispatches a SimulationDataChangeRequestEvent.DATA_CHANGE_REQUEST
event. If this
property value is false
, the SimulationPlayer class will call the ISimulation object's getData()
method to populate the data change request event object.
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
.
Note that the MagicBox sample simulation in the AS3 RTE DevKit returns a value of true
for this
property.
public function get ownerGetsData():Boolean
onSimulationDataChanged | () | method |
public function onSimulationDataChanged(simulation:ISimulation, changeData:*):void
Invoked when simulation data has changed.
Note that this method may be invoked as a result of the implementer successfully dispatching
the SimulationDataChangeRequestEvent.DATA_CHANGE_REQUEST
event. The format of the
changeData
parameter is simulation-specific.
Parameters
simulation:ISimulation — The simulation object whose data has changed.
| |
changeData:* — The data that has changed.
|
simulationDataChangeRequest | Event |
impression.events.SimulationDataChangeRequestEvent
impression.events.SimulationDataChangeRequestEvent.DATA_CHANGE_REQUEST
Dispatch when the user interface wants to change the simulation state.
Note that this event can be cancelled. If the event is cancelled, it is the responsibility of the ISimulationUI object to restore the visual state of the user interface to the state prior to the change request.
The SimulationDataChangeRequestEvent.DATA_CHANGE_REQUEST constant defines the value of the type property of a data change request event object. This event has the following properties:Property | Value |
---|---|
bubbles | false |
cancelable | true ; cancelling the event means that the simulation will not accept the change. |
currentTarget | The object that is actively processing the Event object with an event listener. |
target | The object that raised the event. |
changeData | The proposed data to be changed. |
See also
simulationDataRequest | Event |
impression.events.SimulationDataRequestEvent
impression.events.SimulationDataRequestEvent.DATA_REQUEST
Dispatch when the user interface needs simulation data.
The SimulationDataRequestEvent.DATA_REQUEST constant defines the value of the type property of a data request 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. |
request | The data change request. |
data | The simulation data. |
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. |