Packageorg.ffilmation.engine.elements
Classpublic class fObject
InheritancefObject Inheritance fRenderableElement Inheritance fElement Inheritance flash.events.EventDispatcher
SubclassesfCharacter

An Object is a graphic element that is part of the the environment and is not projected in any way. The library item is attached to the scene as is. Objects cast and receive shadows.

Trees, statues and furniture are typical examples of objects.

Objects can't be moved and can't be added/removed dynamically because this allows several rendering optimizations. If you want to move something or add/remove it on the fly use the "Character" class instead

YOU CAN'T CREATE INSTANCES OF THIS OBJECT.
Objects are created when the scene is processed

See also

org.ffilmation.engine.elements.fCharacter


Public Properties
 PropertyDefined by
  animated : Boolean
This property provides a bit of rendering optimization.
fObject
 InheritedcastShadows : Boolean = true
Boolean value indicating if this object casts shadows.
fRenderableElement
 Inheritedcontainer : MovieClip

WARNING!!!: This property only exists when the scene is being rendered and the graphic elements have been created.

fRenderableElement
 Inheritedcontroller : fEngineElementController
Assigns a controller to this element
fElement
 InheritedcustomData : Object
As elements are not defined as "dynamic", this property can be used to store extra info about this element at run-time.
fElement
  definitionID : String
The definition ID for this fObject.
fObject
 InheritedflashClip : MovieClip
A reference to the library movieclip that was attached to create the element, so you can acces methods inside, nested clips or whatever
fRenderableElement
  height : Number
The height in pixels of an imaginary cilinder enclosing the object.
fObject
 Inheritedid : String
The string identifier of this element.
fElement
  orientation : Number
The orientation (in degrees) of the object along the Z axis.
fObject
  radius : Number
[read-only] The radius in pixels of an imaginary cilinder enclosing the object.
fObject
 InheritedreceiveLights : Boolean = true
Boolean value indicating if this object receives lighting.
fRenderableElement
 InheritedreceiveShadows : Boolean = true
Boolean value indicating if this object receives shadows.
fRenderableElement
 Inheritedsolid : Boolean = true
Boolean value indicating if this object collides with others.
fRenderableElement
 Inheritedx : Number
X coordinate fot this element
fElement
 InheritedxmlObj : XML
This is the XML node from the scene XML that generated this element.
fElement
 Inheritedy : Number
Y coordinate for this element
fElement
 Inheritedz : Number
Z coordinate for this element
fElement
Public Methods
 MethodDefined by
  
call(what:String, param:* = null):void
Calls a function of the base clip
fObject
 Inherited
Mouse management
fRenderableElement
 Inherited
distanceTo(x:Number, y:Number, z:Number):Number
Returns the distance of this element to the given coordinate
fElement
 Inherited
Mouse management
fRenderableElement
 Inherited
follow(target:fElement, elasticity:Number = 0):void
Makes element follow target element
fElement
  
gotoAndPlay(where:*):void
Passes the stardard gotoAndPLay command to the base clip
fObject
  
gotoAndStop(where:*):void
Passes the stardard gotoAndStop command to the base clip
fObject
 Inherited
hide():void
Makes element invisible
fRenderableElement
  
moveTo(x:Number, y:Number, z:Number):void
fObject
 Inherited
show():void
Makes element visible
fRenderableElement
 Inherited
stopFollowing(target:fElement):void
Stops element from following another element
fElement
  
updateDepth():void
fObject
Public Constants
 ConstantDefined by
 InheritedHIDE : String = "renderableElementHide"
[static] The fRenderableElement.HIDE constant defines the value of the type property of the event object for a renderableElementHide event.
fRenderableElement
  MAXSHADOW : * = 2
[static] Limits size of object shadow projection relative to X times the object's height (amount of stretching movieClips will suffer)
fObject
 InheritedMOVE : String = "elementmove"
[static] The fElement.MOVE constant defines the value of the type property of the event object for a elementmove event.
fElement
 InheritedNEWCELL : String = "elementnewcell"
[static] The fElement.NEWCELL constant defines the value of the type property of the event object for a elementnewcell event.
fElement
  SHADOWRANGE : * = 100
[static] Shadows are harder or softer depending on the distance from the shadow origin to the plane where the shadow is drawn This constant defines the max distance in pixels at which a shadow will be seen.
fObject
  SHADOWSCALE : * = 0.7
[static] Shadows become bigger as they fade away.
fObject
 InheritedSHOW : String = "renderableElementShow"
[static] The fRenderableElement.SHOW constant defines the value of the type property of the event object for a renderableElementShow event.
fRenderableElement
Property detail
animatedproperty
public var animated:Boolean

This property provides a bit of rendering optimization. Non-Animated objects can be rendered faster if their cacheAsBitmap property is set to true. For animated objects this would slowdown performance as the cache would be redrawn continuously. Don't confuse "animated" ( a looping movieClip ) with "moveable". fObjects default to non-animated and fCharacters default to animated. You can use the animated attribute in your XMLs to change this

definitionIDproperty 
public var definitionID:String

The definition ID for this fObject. It is useful for example when processing collision events, as it will allow you to know what kind of thing did you collide against.

heightproperty 
height:Number  [read-write]

The height in pixels of an imaginary cilinder enclosing the object. It is used only for colision detection. You can change it anytime This is useful for example if a character has rolling or crawling movements and you want to change its collision height during those movements.

Implementation
    public function get height():Number
    public function set height(value:Number):void
orientationproperty 
orientation:Number  [read-write]

The orientation (in degrees) of the object along the Z axis. That is, if the object was a man standing anywhere on our scene, this would be where was his nose pointing. The default value of 0 indicates it is "looking" towards the positive X axis. The Axis in the Filmation Engine go like this.

  
     positive Z
             |
             |      / positive X
             |    /
             |  /
      (0,0,0) X/
              \
                \
                  \
                    \ positive Y
    

Implementation
    public function get orientation():Number
    public function set orientation(value:Number):void
radiusproperty 
radius:Number  [read-only]

The radius in pixels of an imaginary cilinder enclosing the object. It is used only for colision detection.

Implementation
    public function get radius():Number
Method detail
call()method
public override function call(what:String, param:* = null):void

Calls a function of the base clip

Parameters
what:String — Name of the function to call
 
param:* (default = null) — An optional extra parameter to pass to the function
gotoAndPlay()method 
public override function gotoAndPlay(where:*):void

Passes the stardard gotoAndPLay command to the base clip

Parameters
where:* — A frame number or frame label
gotoAndStop()method 
public override function gotoAndStop(where:*):void

Passes the stardard gotoAndStop command to the base clip

Parameters
where:* — A frame number or frame label
moveTo()method 
public override function moveTo(x:Number, y:Number, z:Number):voidParameters
x:Number
 
y:Number
 
z:Number
updateDepth()method 
public function updateDepth():void
Constant detail
MAXSHADOWconstant
public static const MAXSHADOW:* = 2

Limits size of object shadow projection relative to X times the object's height (amount of stretching movieClips will suffer)

SHADOWRANGEconstant 
public static const SHADOWRANGE:* = 100

Shadows are harder or softer depending on the distance from the shadow origin to the plane where the shadow is drawn This constant defines the max distance in pixels at which a shadow will be seen. The shadow's alpha values will fade from 1 to 0 along this distance

SHADOWSCALEconstant 
public static const SHADOWSCALE:* = 0.7

Shadows become bigger as they fade away. This is the scaling factor -1. 1 means the shadow doubles in size