Packagesekati.ui
Classpublic class RotationPlane
InheritanceRotationPlane Inheritance InteractiveSprite Inheritance CoreSprite Inheritance flash.display.Sprite

RotationPlane provides a two dimensional plane containing two "material" DisplayObject's which can be manipulated via rotateX, rotateY.



Public Properties
 PropertyDefined by
 Inheritedenabled : Boolean
Enabled property defines whether interactive eventing is available or not.
InteractiveSprite
  focalLength : Number
Determines the amount of focal distortion: the higher the value the less distortion.
RotationPlane
 InheritedinteractiveMode : Boolean
Specifies the mouse cursors modal state in the object as an interactive target via: buttonMode, mouseChildren & tabChildren.
CoreSprite
  isInvertBackPlane : Boolean
Determines the orientation of the back material (material1) to the front material (material0) must be set manually after initialization.
RotationPlane
  isReversePlaneVisible : Boolean
Determines whether the reverse plane material will always be visible (true) or not (false).
RotationPlane
  material0 : DisplayObject
The DisplayObject "material" used on the first (front) side of the plane.
RotationPlane
  material1 : DisplayObject
The DisplayObject "material" used on the second (reverse) side of the plane.
RotationPlane
  rotateX : Number
Rotation of the plane on the X-axis (vertical movement).
RotationPlane
  rotateY : Number
Rotation of the plane on the Y-axis (horizontal movement).
RotationPlane
 Inheritedscale : Number
The scale value.
CoreSprite
  smoothing : Boolean
Determines whether the BitmapData smoothing is applied to the plane rotations or not.
RotationPlane
Protected Properties
 PropertyDefined by
  _backBitmapTransform : BitmapTransform
RotationPlane
  _bmpd0 : CoreBitmapData
RotationPlane
  _bmpd1 : CoreBitmapData
RotationPlane
  _btArray : Array
RotationPlane
  _facesArray : Array
RotationPlane
  _focalLength : Number
RotationPlane
  _frontBitmapTransform : BitmapTransform
RotationPlane
  _hSegments : int
RotationPlane
  _isInvertBackPlane : Boolean
RotationPlane
  _isReversePlaneVisible : Number
RotationPlane
  _masterHeight : Number
RotationPlane
  _masterWidth : Number
RotationPlane
  _material0 : DisplayObject
RotationPlane
  _material1 : DisplayObject
RotationPlane
  _numFaces : uint
RotationPlane
  _numVertices : uint
RotationPlane
  _orientation : String
RotationPlane
  _renderReady : Boolean
RotationPlane
  _rotationX : Number
RotationPlane
  _rotationY : Number
RotationPlane
  _side0 : Sprite
RotationPlane
  _side1 : Sprite
RotationPlane
  _smoothing : Boolean
RotationPlane
  _spCube : Sprite
RotationPlane
  _vertsArray : Array
RotationPlane
  _wSegments : int
RotationPlane
Public Methods
 MethodDefined by
  
RotationPlane(material0:DisplayObject, material1:DisplayObject, focalLength:uint = 1500, wsegments:int = 5, hsegments:int = 5, smoothing:Boolean = false)
RotationPlane Constructor
RotationPlane
 Inherited
addChildren(... args):void
Add multiple child DisplayObject's.
CoreSprite
 Inherited
destroy():void
Clean up after thy self.
InteractiveSprite
 Inherited
toString():String
Return reflective output.
CoreSprite
  
Update the BitmapData for material0.
RotationPlane
  
Update the BitmapData for material1.
RotationPlane
  
Update the BitmapData for both materials on the plane.
RotationPlane
Protected Methods
 MethodDefined by
  
Align the materials.
RotationPlane
  
Determine width : height relationships.
RotationPlane
 Inherited
click(e:MouseEvent = null):void
Stub: click event handler.
InteractiveSprite
  
Configure the back plane (material1).
RotationPlane
  
Configure the front plane (material0).
RotationPlane
 Inherited
configListeners(isAdd:Boolean = false):void
Event listener management.
InteractiveSprite
  
init3D():void
Initialize 3D logic.
RotationPlane
 Inherited
invalidate():void
Request a redraw, use for deferred rendering.
CoreSprite
 Inherited
offStage(e:Event = null):void
Remove the listeners when removed from the stage.
InteractiveSprite
 Inherited
onStage(e:Event = null):void
Add listeners when added to stage.
InteractiveSprite
 Inherited
out(e:MouseEvent = null):void
Stub: mouse out event handler.
InteractiveSprite
 Inherited
over(e:MouseEvent = null):void
Stub: mouse over event handler.
InteractiveSprite
  
pointNewView(v:Array, theta:Number, phi:Number):Array
Aquire the new view coordinates.
RotationPlane
 Inherited
press(e:MouseEvent = null):void
Stub: press event handler.
InteractiveSprite
 Inherited
release(e:MouseEvent = null):void
Stub: release event handler.
InteractiveSprite
 Inherited
releaseOutside(e:Event = null):void
Stub: release outside event handler.
InteractiveSprite
  
renderView(t:Number, p:Number):void
Render the view.
RotationPlane
  
Swap display objects.
RotationPlane
Protected Constants
 ConstantDefined by
  X_ORIENTED : String = "x"
[static]
RotationPlane
  Y_ORIENTED : String = "y"
[static]
RotationPlane
Property detail
_backBitmapTransformproperty
protected var _backBitmapTransform:BitmapTransform
_bmpd0property 
protected var _bmpd0:CoreBitmapData
_bmpd1property 
protected var _bmpd1:CoreBitmapData
_btArrayproperty 
protected var _btArray:Array
_facesArrayproperty 
protected var _facesArray:Array
_focalLengthproperty 
protected var _focalLength:Number
focalLengthproperty 
focalLength:Number  [read-write]

Determines the amount of focal distortion: the higher the value the less distortion. (Recommended value: 1000-2000).

Implementation
    public function get focalLength():Number
    public function set focalLength(value:Number):void
_frontBitmapTransformproperty 
protected var _frontBitmapTransform:BitmapTransform
_hSegmentsproperty 
protected var _hSegments:int
_isInvertBackPlaneproperty 
protected var _isInvertBackPlane:Boolean
isInvertBackPlaneproperty 
isInvertBackPlane:Boolean  [read-write]

Determines the orientation of the back material (material1) to the front material (material0) must be set manually after initialization.

Note: this is a totally new usage that will break existing implementations of rotationplane.

Implementation
    public function get isInvertBackPlane():Boolean
    public function set isInvertBackPlane(value:Boolean):void
_isReversePlaneVisibleproperty 
protected var _isReversePlaneVisible:Number
isReversePlaneVisibleproperty 
isReversePlaneVisible:Boolean  [read-write]

Determines whether the reverse plane material will always be visible (true) or not (false).

Implementation
    public function get isReversePlaneVisible():Boolean
    public function set isReversePlaneVisible(value:Boolean):void
_masterHeightproperty 
protected var _masterHeight:Number
_masterWidthproperty 
protected var _masterWidth:Number
_material0property 
protected var _material0:DisplayObject
material0property 
material0:DisplayObject  [read-write]

The DisplayObject "material" used on the first (front) side of the plane.

Implementation
    public function get material0():DisplayObject
    public function set material0(value:DisplayObject):void
_material1property 
protected var _material1:DisplayObject
material1property 
material1:DisplayObject  [read-write]

The DisplayObject "material" used on the second (reverse) side of the plane.

Implementation
    public function get material1():DisplayObject
    public function set material1(value:DisplayObject):void
_numFacesproperty 
protected var _numFaces:uint
_numVerticesproperty 
protected var _numVertices:uint
_orientationproperty 
protected var _orientation:String
_renderReadyproperty 
protected var _renderReady:Boolean
rotateXproperty 
rotateX:Number  [read-write]

Rotation of the plane on the X-axis (vertical movement).

Note: rotateX is used instead of rotationX for compatability purposes between FP9 and FP10's inherited rotationX

Implementation
    public function get rotateX():Number
    public function set rotateX(value:Number):void
rotateYproperty 
rotateY:Number  [read-write]

Rotation of the plane on the Y-axis (horizontal movement).

Note: rotateY is used instead of rotationY for compatability purposes between FP9 and FP10's inherited rotationY

Implementation
    public function get rotateY():Number
    public function set rotateY(value:Number):void
_rotationXproperty 
protected var _rotationX:Number
_rotationYproperty 
protected var _rotationY:Number
_side0property 
protected var _side0:Sprite
_side1property 
protected var _side1:Sprite
_smoothingproperty 
protected var _smoothing:Boolean
smoothingproperty 
smoothing:Boolean  [read-write]

Determines whether the BitmapData smoothing is applied to the plane rotations or not.

Implementation
    public function get smoothing():Boolean
    public function set smoothing(value:Boolean):void
_spCubeproperty 
protected var _spCube:Sprite
_vertsArrayproperty 
protected var _vertsArray:Array
_wSegmentsproperty 
protected var _wSegments:int
Constructor detail
RotationPlane()constructor
public function RotationPlane(material0:DisplayObject, material1:DisplayObject, focalLength:uint = 1500, wsegments:int = 5, hsegments:int = 5, smoothing:Boolean = false)

RotationPlane Constructor

Parameters
material0:DisplayObject — the first (front) DisplayObject.
 
material1:DisplayObject — the second (back) DisplayObject.
 
focalLength:uint (default = 1500) — the amount of focal distortion: the higher the value the less distortion. (Recommended value: 1000-2000).
 
wsegments:int (default = 5) — the number of horizontal segments (divisons) to slice the materials (effects distortion).
 
hsegments:int (default = 5) — the number of vertical segments (divisons) to slice the materials (effects distortion).
 
smoothing:Boolean (default = false) — determines whether the rotational transformation BitmapData is smoothed or not (effects performance).

See also


Example
   var plane : RotationPlane = new RotationPlane( loader0.content, loader1.content, RotationPlane.X_ORIENTED );
   plane.addEventListener( MouseEvent.MOUSE_OVER, rotationBack );
   plane.addEventListener( MouseEvent.MOUSE_OUT, rotationFront );
   addChild( plane );
    
   private function rotationBack(e : MouseEvent) : void {
     Tweener.addTween( plane, { rotateX:180, time:0.7 } );
   }
     
   private function rotationFront(e : MouseEvent) : void {
     Tweener.addTween( plane, { rotateY:0, time:0.7 } );
   }
   

Method detail
alignMaterials()method
protected function alignMaterials():void

Align the materials.

calculateMasterDimensions()method 
protected function calculateMasterDimensions():void

Determine width : height relationships.

configBackPlane()method 
protected function configBackPlane():void

Configure the back plane (material1).

configFrontPlane()method 
protected function configFrontPlane():void

Configure the front plane (material0).

init3D()method 
protected function init3D():void

Initialize 3D logic.

pointNewView()method 
protected function pointNewView(v:Array, theta:Number, phi:Number):Array

Aquire the new view coordinates.

Parameters
v:Array
 
theta:Number
 
phi:Number

Returns
Array
renderView()method 
protected function renderView(t:Number, p:Number):void

Render the view.

Parameters
t:Number
 
p:Number
swapDisplayObjects()method 
protected function swapDisplayObjects():void

Swap display objects.

updateMaterial0()method 
public function updateMaterial0():void

Update the BitmapData for material0.

updateMaterial1()method 
public function updateMaterial1():void

Update the BitmapData for material1.

updateMaterials()method 
public function updateMaterials():void

Update the BitmapData for both materials on the plane.

Constant detail
X_ORIENTEDconstant
protected static const X_ORIENTED:String = "x"
Y_ORIENTEDconstant 
protected static const Y_ORIENTED:String = "y"