Packageflexlib.controls
Classpublic class Fire
InheritanceFire Inheritance mx.core.UIComponent

Fire produces a simulated fire or smoke-like effect.

By adjusting various parameters you can achieve a wide variety of different effects. Fire allows you to generate a multi-colored flame by setting the colors array.



Public Properties
 PropertyDefined by
  angle : Number
The angle that is used to generate the radial gradient that is used for the
Fire
  color : uint
Fire can be customized to display in any color by setting the color property.
Fire
  colors : Array
An array of colors that will color the Flame.
Fire
  delay : Number
The delay in ms between visual updates.
Fire
  detail : int
Level of detail for the flame.
Fire
  displacementScaleX : Number = 50
The scaleX factor that is used to generate the DisplacementMapFilter.
Fire
  displacementScaleY : Number = 50
The scaleY factor that is used to generate the DisplacementMapFilter.
Fire
  fireBlendMode : String
The blendMode to use for the Flame object.
Fire
  hFactor : Number = 5
Determines how much "distortion" there is vertically.
Fire
  wFactor : Number = 6
Determines how much "distortion" there is horizontally.
Fire
  xSpeed : Number = 0
The speed of the flame moving horizontally.
Fire
  ySpeed : Number = 1
The speed of the flame moving vertically.
Fire
Public Methods
 MethodDefined by
  
startBurning():void
Re-starts the animated flame animation, if it has been previously stopped by using the stopBurning funtion.
Fire
  
stopBurning():void
Stops the animated flame burning.
Fire
Protected Methods
 MethodDefined by
  
Fire
  
createInput(g:Graphics, w:Number, h:Number):void
Creates the base bitmap that we're going to be applying the DisplacementMapFilter to.
Fire
  
makeNoise(event:Event):void
Rawr! OK, not that type of noise.
Fire
  
updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
Fire
Property detail
angleproperty
angle:Number  [read-write]

The angle that is used to generate the radial gradient that is used for the

Implementation
    public function get angle():Number
    public function set angle(value:Number):void
colorproperty 
color:uint  [read-write]

Fire can be customized to display in any color by setting the color property. You can also use the colors property to set an array of colors. If you set color instead of colors then it is the same as setting colors to an array with only one color.

This property can be used as the source for data binding.

Implementation
    public function get color():uint
    public function set color(value:uint):void
colorsproperty 
colors:Array  [read-write]

An array of colors that will color the Flame. You can specify any number of colors, they will form a gradient from one to the other. The colors are ordered from the inside of the flame toward the outside.

This property can be used as the source for data binding.

Implementation
    public function get colors():Array
    public function set colors(value:Array):void
delayproperty 
delay:Number  [read-write]

The delay in ms between visual updates. Setting this to a higher number will slow the visual updating, maybe enhancing performance. Setting this to 0 makes the effect run based on the ENTER_FRAME event. If you set this to anything higher than 0 you will see choppiness in the effect (the higher the number the less smooth).

This property can be used as the source for data binding.

Implementation
    public function get delay():Number
    public function set delay(value:Number):void
detailproperty 
detail:int  [read-write]

Level of detail for the flame. What this is actually doing is using this number as the octave parameter for the perlinNoise function. Be careful with values over 3 or 4, the CPU usage increases as this property increases. And if you go over about 5 it's hard to see much of a visual difference.

Implementation
    public function get detail():int
    public function set detail(value:int):void
displacementScaleXproperty 
public var displacementScaleX:Number = 50

The scaleX factor that is used to generate the DisplacementMapFilter.

This property can be used as the source for data binding.

displacementScaleYproperty 
public var displacementScaleY:Number = 50

The scaleY factor that is used to generate the DisplacementMapFilter.

The default value is 50.

This property can be used as the source for data binding.

fireBlendModeproperty 
fireBlendMode:String  [read-write]

The blendMode to use for the Flame object.

The default value is BlendMode.SCREEN.

This property can be used as the source for data binding.

Implementation
    public function get fireBlendMode():String
    public function set fireBlendMode(value:String):void
hFactorproperty 
public var hFactor:Number = 5

Determines how much "distortion" there is vertically. Values must be greater than 0.

This property can be used as the source for data binding.

wFactorproperty 
public var wFactor:Number = 6

Determines how much "distortion" there is horizontally. Values must be greater than 0.

This property can be used as the source for data binding.

xSpeedproperty 
public var xSpeed:Number = 0

The speed of the flame moving horizontally. Use a positive number to have the flame appear to go left. A negatrive number will make it go right.

ySpeedproperty 
public var ySpeed:Number = 1

The speed of the flame moving vertically. Use a positive number to have the flame appear to go up. A negatrive number will make it go downward.

Method detail
createChildren()method
protected override function createChildren():void
createInput()method 
protected function createInput(g:Graphics, w:Number, h:Number):void

Creates the base bitmap that we're going to be applying the DisplacementMapFilter to. Override this to create different types of Fire (or water) effects.

Parameters
g:Graphics
 
w:Number
 
h:Number
makeNoise()method 
protected function makeNoise(event:Event):void

Rawr! OK, not that type of noise. This does all the heavy lifting to create the fire effect. If you wanted to extend this component and use your own algorithm for distortion, you can override this method. This method should set the bitmapData of the output variable.

Parameters
event:Event
startBurning()method 
public function startBurning():void

Re-starts the animated flame animation, if it has been previously stopped by using the stopBurning funtion.

stopBurning()method 
public function stopBurning():void

Stops the animated flame burning. The component will remain with the last flame image that was generated.

updateDisplayList()method 
protected override function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):voidParameters
unscaledWidth:Number
 
unscaledHeight:Number