Packagealternativa.engine3d.core
Classpublic class Surface
Implementsflash.events.IEventDispatcher

Surface, a set of faces, set together in a group to have an ability to work with their common properties.



Public Properties
 PropertyDefined by
  faces : Set
[read-only] A set of surface faces.
Surface
  id : Object
[read-only] Surface identifier in Mesh-object.
Surface
  material : SurfaceMaterial
Surface material.
Surface
  mesh : Mesh
[read-only] Mesh-object containing given surface.
Surface
  mouseEnabled : Boolean = true
Specifies whether this surface receives mouse messages.
Surface
Public Methods
 MethodDefined by
  
Creates a surface instance.
Surface
  
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
Registers an event listener.
Surface
  
addFace(face:Object):void
Add face to surface.
Surface
  
dispatchEvent(event:Event):Boolean
Dispatches an event.
Surface
  
hasEventListener(type:String):Boolean
Checks if there are registered event listeners for events with the given type.
Surface
  
removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
Removes an event listener.
Surface
  
removeFace(face:Object):void
Delete face from surface.
Surface
  
toString():String
Get string representation of object.
Surface
  
willTrigger(type:String):Boolean
Surface
Events
 EventSummaryDefined by
   Dispatched when a user presses and releases left mouse button over the same surface.Surface
   Dispatched when a user presses left mouse button over a surface.Surface
   Dispatched when a user moves mouse cursor while it is over a surface.Surface
   Dispatched when a user moves mouse cursor away from a surface.Surface
   Dispatched when a user moves mouse cursor over a surface.Surface
   Dispatched when a user releases left mouse button over a surface.Surface
   Dispatched when a user spins mouse wheel over a surface.Surface
Property detail
facesproperty
faces:Set  [read-only]

A set of surface faces.

Implementation
    public function get faces():Set
idproperty 
id:Object  [read-only]

Surface identifier in Mesh-object. If surface does not belong to any Mesh-object, identifier value is set to null.

Implementation
    public function get id():Object
materialproperty 
material:SurfaceMaterial  [read-write]

Surface material. When new material is assigned, old one will be deleted.

Implementation
    public function get material():SurfaceMaterial
    public function set material(value:SurfaceMaterial):void
meshproperty 
mesh:Mesh  [read-only]

Mesh-object containing given surface.

Implementation
    public function get mesh():Mesh
mouseEnabledproperty 
public var mouseEnabled:Boolean = true

Specifies whether this surface receives mouse messages.

Constructor detail
Surface()constructor
public function Surface()

Creates a surface instance.

Method detail
addEventListener()method
public function addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void

Registers an event listener.

Parameters
type:Stringthe type of an event
 
listener:Functionthe listener function
 
useCapture:Boolean (default = false)not used
 
priority:int (default = 0)the priority level of the event listener. All listeners with priority n are processed before listeners of priority n-1. If two or more listeners share the same priority, they are processed in the order in which they were added.
 
useWeakReference:Boolean (default = false)Determines whether the reference to the listener is strong or weak. A strong reference prevents your listener from being garbage-collected. A weak reference does not.
addFace()method 
public function addFace(face:Object):void

Add face to surface.

Parameters
face:ObjectFace class instance

Throws
FaceNotFoundError an attempt to add face that is already there
 
InvalidIDError an attempt to add face that is already there
 
FaceExistsError an attempt to add face that is already there

See also

dispatchEvent()method 
public function dispatchEvent(event:Event):Boolean

Dispatches an event.

Parameters
event:Eventthe event to dispatch

Returns
Booleanfalse
hasEventListener()method 
public function hasEventListener(type:String):Boolean

Checks if there are registered event listeners for events with the given type.

Parameters
type:Stringthe type of an event

Returns
Booleantrue if there are listeners of events with the specified type, otherwise false
removeEventListener()method 
public function removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void

Removes an event listener.

Parameters
type:Stringthe type of an event
 
listener:Functionthe listener function
 
useCapture:Boolean (default = false)not used
removeFace()method 
public function removeFace(face:Object):void

Delete face from surface. Face can be referred by alternativa.engine3d.core.Face class instance or Mesh-object face identifier.

Parameters
face:ObjectFace class instance or face identifier.

Throws
FaceNotFoundError an attempt to refer to a face with reserved value
 
InvalidIDError an attempt to refer to a face with reserved value

See also

toString()method 
public function toString():String

Get string representation of object.

Returns
Stringa string representation of the object
willTrigger()method 
public function willTrigger(type:String):Boolean

Parameters
type:String

Returns
Boolean
Event detail
clickevent 
Event object type: alternativa.engine3d.events.MouseEvent3D
MouseEvent3D.type property = alternativa.engine3d.events.MouseEvent3D.CLICK

Dispatched when a user presses and releases left mouse button over the same surface.

The value of the type property of a click event object.
mouseDownevent  
Event object type: alternativa.engine3d.events.MouseEvent3D
MouseEvent3D.type property = alternativa.engine3d.events.MouseEvent3D.MOUSE_DOWN

Dispatched when a user presses left mouse button over a surface.

The value of the type property of a mouseDown event object.
mouseMoveevent  
Event object type: alternativa.engine3d.events.MouseEvent3D
MouseEvent3D.type property = alternativa.engine3d.events.MouseEvent3D.MOUSE_MOVE

Dispatched when a user moves mouse cursor while it is over a surface.

The value of the type property of a mouseMove event object.
mouseOutevent  
Event object type: alternativa.engine3d.events.MouseEvent3D
MouseEvent3D.type property = alternativa.engine3d.events.MouseEvent3D.MOUSE_OUT

Dispatched when a user moves mouse cursor away from a surface.

The value of the type property of a mouseOut event object.
mouseOverevent  
Event object type: alternativa.engine3d.events.MouseEvent3D
MouseEvent3D.type property = alternativa.engine3d.events.MouseEvent3D.MOUSE_OVER

Dispatched when a user moves mouse cursor over a surface.

The value of the type property of a mouseOver event object.
mouseUpevent  
Event object type: alternativa.engine3d.events.MouseEvent3D
MouseEvent3D.type property = alternativa.engine3d.events.MouseEvent3D.MOUSE_UP

Dispatched when a user releases left mouse button over a surface.

The value of the type property of a mouseUp event object.
mouseWheelevent  
Event object type: alternativa.engine3d.events.MouseEvent3D
MouseEvent3D.type property = alternativa.engine3d.events.MouseEvent3D.MOUSE_WHEEL

Dispatched when a user spins mouse wheel over a surface.

The value of the type property of a mouseWheel event object.