Filter object

 < Day Day Up > 

Availability

Flash 8.

Description

This object contains all the properties for all filters. The filter.name property specifies the type of filter, and determines which properties are applicable to each filter. See filter.name. To return the filter list for an object or objects, use document.getFilters(). To apply filters to an object or objects, use document.setFilters(). See document.getFilters() and document.setFilters().

Property summary for the Filter object

The following properties can be used with the Filter object.

Property

Description

filter.angle

A float value that specifies the angle of the shadow or highlight color, in degrees.

filter.blurX

A float value that specifies the amount to blur in the x direction, in pixels.

filter.blurY

A float value that specifies the amount to blur in the y direction.

filter.brightness

A float value that specifies the brightness of the filter.

filter.color

A string, hexadecimal value, or integer that represents the filter color.

filter.contrast

A float value that specifies the contrast value of the filter.

filter.distance

A float value that specifies the distance between the filter's effect and an object, in pixels.

filter.hideObject

A Boolean value that specifies whether the source image is hidden (true) or displayed (false).

filter.highlightColor

A string, hexadecimal value, or integer that represents the highlight color.

filter.hue

A float value that specifies the hue of the filter.

filter.inner

A Boolean value that specifies whether the shadow is an inner shadow (true) or not (false).

filter.knockout

A Boolean value that specifies whether the filter is a knockout filter (TRue) or not (false).

filter.name

A string that specifies the type of filter (read-only property).

filter.quality

A string that specifies the blur quality.

filter.saturation

A float value that specifies the saturation value of the filter.

filter.shadowColor

A string, hexadecimal value, or integer that represents the shadow color.

filter.strength

An integer that specifies the percentage strength of the filter.

filter.type

A string that specifies the type of bevel or glow.


filter.angle

Availability

Flash 8.

Usage

filter.angle

Description

Property; a float value that specifies the angle of the shadow or highlight color, in degrees. Acceptable values are between 0 and 360. This property is defined for Filter objects with a value of "bevelFilter", "dropShadowFilter", "gradientBevelFilter", or "gradientGlowFilter" for the filter.name property.

Example

The following example sets the angle to 120 for the Bevel filters on the selected object(s):

var myFilters = fl.getDocumentDOM().getFilters(); for(i=0; i < myFilters.length; i++) {   if(myFilters[i].name == 'bevelFilter'){     myFilters[i].angle = 120;   } } fl.getDocumentDOM().setFilters(myFilters);

See also

document.setFilterProperty()

filter.blurX

Availability

Flash 8.

Usage

filter.blurX

Description

Property; a float value that specifies the amount to blur in the x direction, in pixels. Acceptable values are between 0 and 255. This property is defined for Filter objects with a value of "bevelFilter", "blurFilter", "dropShadowFilter", "glowFilter", "gradientBevelFilter", or "gradientGlowFilter" for the filter.name property.

Example

The following example sets the blurX value to 30 and the blurY value to 20 for the Blur filters on the selected object(s):

var myFilters = fl.getDocumentDOM().getFilters(); for(i=0; i < myFilters.length; i++){   if(myFilters[i].name == 'blurFilter'){     myFilters[i].blurX = 30;     myFilters[i].blurY = 20;   } } fl.getDocumentDOM().setFilters(myFilters);

See also

document.setFilterProperty(), filter.blurY

filter.blurY

Availability

Flash 8.

Usage

filter.blurY

Description

Property; a float value that specifies the amount to blur in the y direction, in pixels. Acceptable values are between 0 and 255. This property is defined for Filter objects with a value of "bevelFilter", "blurFilter", "dropShadowFilter", "glowFilter", "gradientBevelFilter", or "gradientGlowFilter" for the filter.name property.

Example

See filter.blurX.

See also

document.setFilterProperty(), filter.blurX

filter.brightness

Availability

Flash 8.

Usage

filter.brightness

Description

Property; a float value that specifies the brightness of the filter. Acceptable values are between -100 and 100. This property is defined for Filter objects with a value of "adjustColorFilter" for the filter.name property.

Example

The following example sets the brightness to 30.5 for the Adjust Color filters on the selected object(s):

var myFilters = fl.getDocumentDOM().getFilters(); for(i=0; i < myFilters.length; i++){   if(myFilters[i].name == 'adjustColorFilter'){     myFilters[i].brightness = 30.5;   } } fl.getDocumentDOM().setFilters(myFilters);

filter.color

Availability

Flash 8.

Usage

filter.color

Description

Property; the color of the filter, in one of the following formats:

  • A string in the format "#RRGGBB" or "#RRGGBBAA"

  • A hexadecimal number in the format 0xRRGGBB

  • An integer that represents the decimal equivalent of a hexadecimal number

This property is defined for Filter objects with a value of "dropShadowFilter" or "glowFilter" for the filter.name property.

Example

The following example sets the color to "#ff00003e" for the Drop Shadow filters on the selected object(s):

var myFilters = fl.getDocumentDOM().getFilters(); for(i=0; i < myFilters.length; i++){   if(myFilters[i].name == 'dropShadowFilter'){     myFilters[i].color = '#ff00003e';   } } fl.getDocumentDOM().setFilters(myFilters);

See also

document.setFilterProperty()

filter.contrast

Availability

Flash 8.

Usage

filter.contrast

Description

Property; a float value that specifies the contrast value of the filter. Acceptable values are between -100 and 100. This property is defined for Filter objects with a value of "adjustColorFilter" for the filter.name property.

Example

The following example sets the contrast value to -15.5 for the Adjust Color filters on the selected object(s):

var myFilters = fl.getDocumentDOM().getFilters(); for(i=0; i < myFilters.length; i++){   if(myFilters[i].name == 'adjustColorFilter'){     myFilters[i].contrast = -15.5;   } } fl.getDocumentDOM().setFilters(myFilters);

filter.distance

Availability

Flash 8.

Usage

filter.distance

Description

Property; a float value that specifies the distance between the filter's effect and an object, in pixels. Acceptable values are from -255 to 255. This property is defined for Filter objects with a value of "bevelFilter", "dropShadowFilter", "gradientBevelFilter", or "gradientGlowFilter" for the filter.name property.

Example

The following example sets the distance to 10 pixels for the Drop Shadow filters on the selected object(s):

var myFilters = fl.getDocumentDOM().getFilters(); for(i=0; i < myFilters.length; i++){   if(myFilters[i].name == 'dropShadowFilter'){     myFilters[i].distance = 10;   } } fl.getDocumentDOM().setFilters(myFilters);

See also

document.setFilterProperty()

filter.hideObject

Availability

Flash 8.

Usage

filter.hideObject

Description

Property; a Boolean value that specifies whether the source image is hidden (true) or displayed (false). This property is defined for Filter objects with a value of "dropShadowFilter" for the filter.name property.

Example

The following example sets the hideObject value to TRue for the Drop Shadow filters on the selected object(s):

var myFilters = fl.getDocumentDOM().getFilters(); for(i=0; i < myFilters.length; i++){   if(myFilters[i].name == 'dropShadowFilter'){     myFilters[i].hideObject = true;   } } fl.getDocumentDOM().setFilters(myFilters);

filter.highlightColor

Availability

Flash 8.

Usage

filter.highlightColor

Description

Property; the color of the highlight, in one of the following formats:

  • A string in the format "#RRGGBB" or "#RRGGBBAA"

  • A hexadecimal number in the format 0xRRGGBB

  • An integer that represents the decimal equivalent of a hexadecimal number

This property is defined for Filter objects with a value of "bevelFilter" for the filter.name property.

Example

The following example sets the highlight color to "#ff00003e" for the Bevel filters on the selected object(s):

var myFilters = fl.getDocumentDOM().getFilters(); for(i=0; i < myFilters.length; i++){   if(myFilters[i].name == 'bevelFilter'){     myFilters[i].highlightColor = '#ff00003e';   } } fl.getDocumentDOM().setFilters(myFilters);

filter.hue

Availability

Flash 8.

Usage

filter.hue

Description

Property; a float value that specifies the hue of the filter. Acceptable values are between -180 and 180. This property is defined for Filter objects with a value of "adjustColorFilter" for the filter.name property.

Example

The following example sets the hue to 120 for the Adjust Color filters on the selected object(s):

var myFilters = fl.getDocumentDOM().getFilters(); for(i=0; i < myFilters.length; i++){   if(myFilters[i].name == 'adjustColorFilter'){     myFilters[i].hue = 120;   } } fl.getDocumentDOM().setFilters(myFilters);

filter.inner

Availability

Flash 8.

Usage

filter.inner

Description

Property; a Boolean value that specifies whether the shadow is an inner shadow (true) or not (false). This property is defined for Filter objects with a value of "dropShadowFilter" or "glowFilter" for the filter.name property.

Example

The following example sets the value of the inner property to true for the Glow filters on the selected object(s):

var myFilters = fl.getDocumentDOM().getFilters(); for(i=0; i < myFilters.length; i++){   if(myFilters[i].name == 'glowFilter'){     myFilters[i].inner = true;   } } fl.getDocumentDOM().setFilters(myFilters);

See also

document.setFilterProperty()

filter.knockout

Availability

Flash 8.

Usage

filter.knockout

Description

Property; a Boolean value that specifies whether the filter is a knockout filter (true) or not (false). This property is defined for Filter objects with a value of "bevelFilter", "dropShadowFilter", "glowFilter", "gradientBevelFilter", or "gradientGlowFilter" for the filter.name property.

Example

The following example sets the knockout property to true for the Glow filters on the selected object(s):

var myFilters = fl.getDocumentDOM().getFilters(); for(i=0; i < myFilters.length; i++){   if(myFilters[i].name == 'glowFilter'){     myFilters[i].knockout = true;   } } fl.getDocumentDOM().setFilters(myFilters);

See also

document.setFilterProperty()

filter.name

Availability

Flash 8.

Usage

filter.name

Description

Read-only property; a string that specifies the type of filter. The value of this property determines which other properties of the Filter object are available. The value is one of the following: "adjustColorFilter", "bevelFilter", "blurFilter", "dropShadowFilter", "glowFilter", "gradientBevelFilter", or "gradientGlowFilter".

Example

The following example displays the filter names and index positions in the Output panel:

var myFilters = fl.getDocumentDOM().getFilters(); var traceStr = ""; for(i=0; i < myFilters.length; i++){   traceStr = traceStr + " At index " + i + ": " + myFilters[i].name; } fl.trace(traceStr);

See also

document.getFilters(), document.setFilterProperty()

filter.quality

Availability

Flash 8.

Usage

filter.quality

Description

Property; a string that specifies the blur quality. Acceptable values are "low", "medium", and "high" ("high" is similar to a Gaussian blur). This property is defined for Filter objects with a value of "bevelFilter", "blurFilter", "dropShadowFilter", "glowFilter", "gradientGlowFilter", or "gradientBevelFilter" for the filter.name property.

Example

The following example sets the blur quality to "medium" for the Glow filters on the selected object(s):

var myFilters = fl.getDocumentDOM().getFilters(); for(i=0; i < myFilters.length; i++){   if(myFilters[i].name == 'glowFilter'){     myFilters[i].quality = 'medium';   } } fl.getDocumentDOM().setFilters(myFilters);

See also

document.setFilterProperty()

filter.saturation

Availability

Flash 8.

Usage

filter.saturation

Description

Property; a float value that specifies the saturation value of the filter. Acceptable values are from -100 to 100. This property is defined for Filter objects with a value of "adjustColorFilter" for the filter.name property.

Example

The following example sets the saturation value to 0 (grayscale) for the Adjust Color filters on the selected object(s):

var myFilters = fl.getDocumentDOM().getFilters(); for(i=0; i < myFilters.length; i++){   if(myFilters[i].name == 'adjustColorFilter'){     myFilters[i].saturation = 0;   } } fl.getDocumentDOM().setFilters(myFilters);

See also

document.setFilterProperty()

filter.shadowColor

Availability

Flash 8.

Usage

filter.shadowColor

Description

Property; the color of the shadow, in one of the following formats:

  • A string in the format "#RRGGBB" or "#RRGGBBAA"

  • A hexadecimal number in the format 0xRRGGBB

  • An integer that represents the decimal equivalent of a hexadecimal number

This property is defined for Filter objects with a value of "bevelFilter" for the filter.name property.

Example

The following example sets the shadow color to "#ff00003e" for the Bevel filters on the selected object(s):

var myFilters = fl.getDocumentDOM().getFilters(); for(i=0; i < myFilters.length; i++){   if(myFilters[i].name == 'bevelFilter'){     myFilters[i].shadowColor = '#ff00003e';   } } fl.getDocumentDOM().setFilters(myFilters);

See also

document.setFilterProperty()

filter.strength

Availability

Flash 8.

Usage

filter.strength

Description

Property; an integer that specifies the percentage strength of the filter. Acceptable values are between 0 and 25,500. This property is defined for Filter objects with a value of "bevelFilter", "dropShadowFilter", "glowFilter", "gradientGlowFilter", or "gradientBevelFilter" for the filter.name property.

Example

The following example sets the strength to 50 for the Glow filters on the selected object(s):

var myFilters = fl.getDocumentDOM().getFilters(); for(i=0; i < myFilters.length; i++){   if(myFilters[i].name == 'glowFilter'){     myFilters[i].strength = 50;   } } fl.getDocumentDOM().setFilters(myFilters);

See also

document.setFilterProperty()

filter.type

Availability

Flash 8.

Usage

filter.type

Description

Property; a string that specifies the type of bevel or glow. Acceptable values are "inner", "outer", and "full". This property is defined for Filter objects with a value of "bevelFilter", "gradientGlowFilter", or "gradientBevelFilter" for the filter.name property.

Example

The following example sets the type to "full" for all Bevel filters on the selected object(s):

var myFilters = fl.getDocumentDOM().getFilters(); for(i=0; i < myFilters.length; i++){   if(myFilters[i].name == 'bevelFilter'){     myFilters[i].type = 'full';   } } fl.getDocumentDOM().setFilters(myFilters);

See also

document.setFilterProperty()

     < Day Day Up > 


    Developing Extensions for Macromedia Flash 8
    Developing Extensions for Macromedia Flash 8
    ISBN: 032139416X
    EAN: 2147483647
    Year: 2005
    Pages: 81

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net