BevelFilter constructor

public BevelFilter([distance:Number], [angle:Number], [highlightColor:Number], [highlightAlpha:Number], [shadowColor:Number], [shadowAlpha:Number], [blurX:Number], [blurY:Number], [strength:Number], [quality:Number], [type:String], [knockout:Boolean])

Initializes a new BevelFilter instance with the specified parameters.

Availability: ActionScript 1.0; Flash Player 8

Parameters

distance:Number [optional] - The offset distance of the bevel, in pixels (floating point). The default value is 4.

angle:Number [optional] - The angle of the bevel, from 0 to 360 degrees. The default value is 45.

highlightColor:Number [optional] - The highlight color of the bevel, 0xRRGGBB. The default value is 0xFFFFFF.

highlightAlpha:Number [optional] - The alpha transparency value of the highlight color. Valid values are 0 to 1. For example, .25 sets a transparency value of 25%. The default value is 1.

shadowColor:Number [optional] - The shadow color of the bevel, 0xRRGGBB. The default value is 0x000000.

shadowAlpha:Number [optional] - The alpha transparency value of the shadow color. Valid values are 0 to 1. For example, 0.25 sets a transparency value of 25%. The default value is 1.

blurX:Number [optional] - The amount of horizontal blur in pixels. Valid values are 0 to 255 (floating point). The default value is 4. Values that are a power of 2 (such as 2, 4, 8, 16 and 32) are optimized to render more quickly than other values.

blurY:Number [optional] - The amount of vertical blur in pixels. Valid values are 0 to 255 (floating point). The default value is 4. Values that are a power of 2 (such as 2, 4, 8, 16 and 32) are optimized to render more quickly than other values.

strength:Number [optional] - The strength of the imprint or spread. The larger the value, the more color is imprinted and the stronger the contrast between the bevel and the background. Valid values are 0 to 255. The default value is 1.

quality:Number [optional] - The number of times to apply the filter. The default value is 1, which is equivalent to low quality. A value of 2 is medium quality, and a value of 3 is high quality.

type:String [optional] - The type of bevel. Valid values are "inner", "outer", and "full". The default value is "inner".

knockout:Boolean [optional] - Applies a knockout effect (true), which effectively makes the object's fill transparent and reveals the background color of the document. The default value is false (no knockout).

Example

The following example instantiates a new BevelFilter and applies it to the MovieClip instance (rect):

import flash.filters.BevelFilter;

var distance:Number = 5;
var angleInDegrees:Number = 45;
var highlightColor:Number = 0xFFFF00;
var highlightAlpha:Number = 0.8;
var shadowColor:Number = 0x0000FF;
var shadowAlpha:Number = 0.8;
var blurX:Number = 5;
var blurY:Number = 5;
var strength:Number = 5;
var quality:Number = 3;
var type:String = "inner";
var knockout:Boolean = false;

var filter:BevelFilter = new BevelFilter(distance, 
                                            angleInDegrees, 
                                            highlightColor, 
                                            highlightAlpha, 
                                            shadowColor, 
                                            shadowAlpha, 
                                            blurX, 
                                            blurY, 
                                            strength, 
                                            quality, 
                                            type, 
                                            knockout);

var rect:MovieClip = createRectangle(100, 100, 0x00CC00, "bevelFilterExample");
rect.filters = new Array(filter);

function createRectangle(w:Number, h:Number, bgColor:Number, name:String):MovieClip {
    var rect:MovieClip = this.createEmptyMovieClip(name, this.getNextHighestDepth());
    rect.beginFill(bgColor);
    rect.lineTo(w, 0);
    rect.lineTo(w, h);
    rect.lineTo(0, h);
    rect.lineTo(0, 0);
    rect._x = 20;
    rect._y = 20;
    return rect;
}