Package | flash.filters |
Class | public class BitmapFilter |
Inheritance | BitmapFilter Object |
Subclasses | BevelFilter, BlurFilter, ColorMatrixFilter, ConvolutionFilter, DisplacementMapFilter, DropShadowFilter, GlowFilter, GradientBevelFilter, GradientGlowFilter, ShaderFilter |
Language Version: | ActionScript 3.0 |
Runtime Versions: | AIR 1.0, Flash Player 9 |
The BevelFilter, BlurFilter, ColorMatrixFilter, ConvolutionFilter, DisplacementMapFilter, DropShadowFilter, GlowFilter, GradientBevelFilter, and GradientGlowFilter classes all extend the BitmapFilter class. You can apply these filter effects to any display object.
You can neither directly instantiate nor extend BitmapFilter.
Public Properties
Public Methods
Method | Defined By | ||
---|---|---|---|
Returns a BitmapFilter object that is an exact copy of the original
BitmapFilter object. | BitmapFilter | ||
Indicates whether an object has a specified property defined. | Object | ||
Indicates whether an instance of the Object class is in the prototype chain of the object specified
as the parameter. | Object | ||
Indicates whether the specified property exists and is enumerable. | Object | ||
Sets the availability of a dynamic property for loop operations. | Object | ||
Returns the string representation of this object, formatted according to locale-specific conventions. | Object | ||
Returns the string representation of the specified object. | Object | ||
Returns the primitive value of the specified object. | Object |
Method Detail
clone | () | method |
public function clone():BitmapFilter
Language Version: | ActionScript 3.0 |
Runtime Versions: | AIR 1.0, Flash Player 9 |
Returns a BitmapFilter object that is an exact copy of the original BitmapFilter object.
ReturnsBitmapFilter — A BitmapFilter object.
|
Examples How to use this example
BitmapFilterExample.as
The following example shows how several filters may be applied to a given
DisplayObject object and tracked using the
filters
property.
package { import flash.display.Sprite; import flash.filters.*; public class BitmapFilterExample extends Sprite { public function BitmapFilterExample() { trace(this.filters.length); // 0 var tmpFilters:Array = this.filters; tmpFilters.push(FilterFactory.createFilter(FilterFactory.BEVEL_FILTER)); tmpFilters.push(FilterFactory.createFilter(FilterFactory.GLOW_FILTER)); this.filters = tmpFilters; trace(this.filters.length); // 2 trace(this.filters[0] is BitmapFilter); // true trace(this.filters[0] is BevelFilter); // true trace(this.filters[1] is BitmapFilter); // true trace(this.filters[1] is GlowFilter); // true } } } import flash.filters.*; class FilterFactory { public static var BEVEL_FILTER:String = "BevelFilter"; public static var BevelFilterConstructor:Class = BevelFilter; public static var BLUR_FILTER:String = "BlurFilter"; public static var BlurFilterConstructor:Class = BlurFilter; public static var COLOR_MATRIX_FILTER:String = "ColorMatrixFilter"; public static var ColorMatrixFilterConstructor:Class = ColorMatrixFilter; public static var CONVOLUTION_FILTER:String = "ConvolutionFilter"; public static var ConvolutionFilterConstructor:Class = ConvolutionFilter; public static var DISPLACEMENT_MAP_FILTER:String = "DisplacementMapFilter"; public static var DisplacementMapFilterConstructor:Class = DisplacementMapFilter; public static var DROP_SHADOW_FILTER:String = "DropShadowFilter"; public static var DropShadowFilterConstructor:Class = DropShadowFilter; public static var GLOW_FILTER:String = "GlowFilter"; public static var GlowFilterConstructor:Class = GlowFilter; public static var GRADIENT_BEVEL_FILTER:String = "GradientBevelFilter"; public static var GradientBevelFilterConstructor:Class = GradientBevelFilter; public static var GRADIENT_GLOW_FILTER:String = "GradientGlowFilter"; public static var GradientGlowFilterConstructor:Class = GradientGlowFilter; public static function createFilter(type:String):BitmapFilter { return new FilterFactory[type + "Constructor"](); } }
Mon Nov 28 2011, 06:48 AM -08:00