Packageorg.ffilmation.engine.elements
Classpublic class fCharacter
InheritancefCharacter Inheritance fObject Inheritance fRenderableElement Inheritance fElement Inheritance flash.events.EventDispatcher

A Character is a dynamic object in the scene. Characters can move and rotate, and can be added and removed from the scene at any time. Live creatures and vehicles are the most common uses for the fCharacter class.

There are other uses for fCharacter: If you want a chair to be "moveable", for example, you will have to make it a fCharacter.

You can add the parameter dynamic="true" to the XML definition for any object you want to be able to move later. This will force the engine to make that object a Character.

The main reason of having different classes for static and dynamic objects is that static objects can be added to the light rendering cache along with floors and walls, whereas dynamic objects (characters) can't.

Don't use this class to implement bullets. Use the fBullet class.

YOU CAN'T CREATE INSTANCES OF THIS ELEMENT DIRECTLY.
Use scene.createCharacter() to add new characters to an scene.

See also

org.ffilmation.engine.core.fScene.createCharacter()


Public Properties
 PropertyDefined by
 Inheritedanimated : Boolean = false
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
Retrieves controller from 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
 InheriteddefinitionID : 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
 Inheritedheight : Number
fObject
 Inheritedid : String
The string identifier of this element.
fElement
  occlusion : Number = 100
This value goes from 0 to 100 and indicates the alpha strenght of the "hole" that is opened in planes that cover this character "Cover" means literally, onscreen.
fCharacter
 Inheritedorientation : Number
fObject
 Inheritedradius : Number
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
 Inherited
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
 Inherited
gotoAndPlay(where:*):void
Passes the stardard gotoAndPLay command to the base clip
fObject
 Inherited
gotoAndStop(where:*):void
Passes the stardard gotoAndStop command to the base clip
fObject
 Inherited
hide():void
Makes element invisible
fRenderableElement
 Inherited
moveTo(x:Number, y:Number, z:Number):void
Moves the element to a given position
fElement
 Inherited
show():void
Makes element visible
fRenderableElement
 Inherited
stopFollowing(target:fElement):void
Stops element from following another element
fElement
  
teleportTo(x:Number, y:Number, z:Number):void
Moves a character into a new position, ignoring collisions
fCharacter
Public Constants
 ConstantDefined by
  COLLIDE : String = "charactercollide"
[static] The fCharacter.COLLIDE constant defines the value of the type property of the event object for a charactercollide event.
fCharacter
  EVENT_IN : String = "charactereventin"
[static] The fCharacter.EVENT_IN constant defines the value of the type property of the event object for a charactereventin event.
fCharacter
  EVENT_OUT : String = "charactereventout"
[static] The fCharacter.EVENT_OUT constant defines the value of the type property of the event object for a charactereventout event.
fCharacter
 InheritedHIDE : String = "renderableElementHide"
[static] The fRenderableElement.HIDE constant defines the value of the type property of the event object for a renderableElementHide event.
fRenderableElement
 InheritedMAXSHADOW : * = 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
 InheritedSHADOWRANGE : * = 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
 InheritedSHADOWSCALE : * = 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
  WALKOVER : String = "characterwalkover"
[static] The fCharacter.WALKOVER constant defines the value of the type property of the event object for a characterwalkover event.
fCharacter
Property detail
occlusionproperty
public var occlusion:Number = 100

This value goes from 0 to 100 and indicates the alpha strenght of the "hole" that is opened in planes that cover this character "Cover" means literally, onscreen. This allows you to see what you are doing behind a wall. The default "100" value disables this effect

Method detail
teleportTo()method
public function teleportTo(x:Number, y:Number, z:Number):void

Moves a character into a new position, ignoring collisions

Parameters
x:Number — New x coordinate
 
y:Number — New y coordinate
 
z:Number — New z coordinate
Constant detail
COLLIDEconstant
public static const COLLIDE:String = "charactercollide"

The fCharacter.COLLIDE constant defines the value of the type property of the event object for a charactercollide event. The event is dispatched when the character collides with another element in the scene

EVENT_INconstant 
public static const EVENT_IN:String = "charactereventin"

The fCharacter.EVENT_IN constant defines the value of the type property of the event object for a charactereventin event. The event is dispatched when the character enters a cell where an event was defined

EVENT_OUTconstant 
public static const EVENT_OUT:String = "charactereventout"

The fCharacter.EVENT_OUT constant defines the value of the type property of the event object for a charactereventout event. The event is dispatched when the character leaves a cell where an event was defined

WALKOVERconstant 
public static const WALKOVER:String = "characterwalkover"

The fCharacter.WALKOVER constant defines the value of the type property of the event object for a characterwalkover event. The event is dispatched when the character walks over a non-solid object of the scene