StrokeFilter

Manages bitmap filter effects applied to a Stroke shape.

Summary
StrokeFilterManages bitmap filter effects applied to a Stroke shape.
Private members
shapeReference to Stroke shape which filters are managed.
Creation
StrokeFilterConstructor that stores a reference to the shape to manage filters for.
addBevelFilterAdd a Bevel filter to the shape if it does not have one.
addBlurFilterAdd a Blur filter to the shape if it does not have one.
addShadowFilterAdd a DropShadow filter to the shape if it does not have one.
Destruction
clearRemove all filters from the shape.
disposeRemove all filters from the shape and remove any reference to the shape.
Query Properties
hasFiltersDetermines if the shape has any blur, bevel or drop shadow filters.
withBevelDetermines if the shape has a bevel filter.
withBlurDetermines if the shape has a blur filter.
withShadowDetermines if the shape has a drop shadow filter.
Reverse engineering
setBlurParamsAdds a blur filter to the shape with the given parameters.
setBevelParamsAdds a bevel filter to the shape with the given parameters.
setDropShadowParamsAdds a dropshadow filter to the shape with the given parameters.
Public filter query
Private filter manipulation
applyFilterApplies a filter to the shape.
findFilterIndexFind the first filter on the displayObject with a class name that matches the filterClassName.

Private members

shape

private var shape: DisplayObject

Reference to Stroke shape which filters are managed.

Creation

StrokeFilter

public function StrokeFilter(shape: DisplayObject)

Constructor that stores a reference to the shape to manage filters for.

Parameters

shapea DisplayObject shape or sprite

addBevelFilter

public function addBevelFilter():void

Add a Bevel filter to the shape if it does not have one.

addBlurFilter

public function addBlurFilter():void

Add a Blur filter to the shape if it does not have one.

addShadowFilter

public function addShadowFilter():void

Add a DropShadow filter to the shape if it does not have one.

Destruction

clear

public function clear():void

Remove all filters from the shape.

dispose

public function dispose():void

Remove all filters from the shape and remove any reference to the shape.

Query Properties

hasFilters

public function get hasFilters():Boolean

Determines if the shape has any blur, bevel or drop shadow filters.

Returns

True if found, false otherwise

withBevel

public function get withBevel():Boolean

Determines if the shape has a bevel filter.

Returns

True if found, false otherwise

withBlur

public function get withBlur():Boolean

Determines if the shape has a blur filter.

Returns

True if found, false otherwise

withShadow

public function get withShadow():Boolean

Determines if the shape has a drop shadow filter.

Returns

True if found, false otherwise

Reverse engineering

setBlurParams

public function setBlurParams(params: Array):void

Adds a blur filter to the shape with the given parameters.

Parameters

paramsarray of parameters as obtained from MethodParser.parseParameters

setBevelParams

public function setBevelParams(params: Array):void

Adds a bevel filter to the shape with the given parameters.

Parameters

paramsarray of parameters as obtained from MethodParser.parseParameters

setDropShadowParams

public function setDropShadowParams(params: Array):void

Adds a dropshadow filter to the shape with the given parameters.

Parameters

paramsarray of parameters as obtained from MethodParser.parseParameters

Public filter query

Private filter manipulation

applyFilter

private function applyFilter(filter: BitmapFilter,
filterTypeName: String):void

Applies a filter to the shape.  Updates shape filter if one exists otherwise adds it.

Parameters

filtera bitmap filter
filterTypeNamea bitmap filter class name

findFilterIndex

private function findFilterIndex(displayObject: DisplayObject,
filterClassName: String):int

Find the first filter on the displayObject with a class name that matches the filterClassName.

The filter class name is taken from flash.filters.

Parameters

displayObjectthe display object to be searched
filterClassNamethe class name of a filter

Returns

The index of the first filter with the class or -1 if no such filter was found

Defines a stroke object consisting of curves, line segments and primitive graphics objects.
private var shape: DisplayObject
Reference to Stroke shape which filters are managed.
public function StrokeFilter(shape: DisplayObject)
Constructor that stores a reference to the shape to manage filters for.
public function addBevelFilter():void
Add a Bevel filter to the shape if it does not have one.
public function addBlurFilter():void
Add a Blur filter to the shape if it does not have one.
public function addShadowFilter():void
Add a DropShadow filter to the shape if it does not have one.
public function clear():void
Remove all filters from the shape.
public function dispose():void
Remove all filters from the shape and remove any reference to the shape.
public function get hasFilters():Boolean
Determines if the shape has any blur, bevel or drop shadow filters.
public function get withBevel():Boolean
Determines if the shape has a bevel filter.
public function get withBlur():Boolean
Determines if the shape has a blur filter.
public function get withShadow():Boolean
Determines if the shape has a drop shadow filter.
public function setBlurParams(params: Array):void
Adds a blur filter to the shape with the given parameters.
public function setBevelParams(params: Array):void
Adds a bevel filter to the shape with the given parameters.
public function setDropShadowParams(params: Array):void
Adds a dropshadow filter to the shape with the given parameters.
private function applyFilter(filter: BitmapFilter,
filterTypeName: String):void
Applies a filter to the shape.
private function findFilterIndex(displayObject: DisplayObject,
filterClassName: String):int
Find the first filter on the displayObject with a class name that matches the filterClassName.
private function parseParameters(paramList: String,
paramArray: Array):void
Scans action method call parameters, pushes found parameters on the given paramArray reference.
Close