< 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 objectThe following properties can be used with the Filter object.
filter.angleAvailability 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.blurXAvailability 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.blurYAvailability 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.brightnessAvailability 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.colorAvailability Flash 8. Usage filter.color Description Property; the color of the filter, in one of the following formats:
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.contrastAvailability 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.distanceAvailability 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.hideObjectAvailability 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.highlightColorAvailability Flash 8. Usage filter.highlightColor Description Property; the color of the highlight, in one of the following formats:
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.hueAvailability 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.innerAvailability 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.knockoutAvailability 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.nameAvailability 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.qualityAvailability 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.saturationAvailability 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.shadowColorAvailability Flash 8. Usage filter.shadowColor Description Property; the color of the shadow, in one of the following formats:
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.strengthAvailability 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.typeAvailability 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 > |