|
||||||
|
||||||
Create Multiple Filters with ActionScript

Free
Flash Tutorial
Step Three: Adding Additional Filters
For each Filter you wish to add you will have to add to additional sections of code. Here I have added in the Blur filter:
Example: Download the Flash file Draw 219c
Flash Movie with the Blur filter added to the Drop Shadow & Glow.
Below in red is the additional code that I have added to get the blur effect. There are two sections. The variable setting up the Blur Filter parameters and the myBlur added to the myObject Array (list).
// Makes all possible filters available to use in the Movie.
import flash.filters.*;// Creates variables with info about the Filter settings
var myGlow = new GlowFilter (0x000066, 0.7, 9, 9, 3, 3, true, false);
var myDrop = new DropShadowFilter(12, 45, 0x000000, .6, 8, 8, 1, 2, false, false, false);
var myBlur = new BlurFilter(10,2,3);// Applies the filters to the object named myObject
myObject.filters = [myGlow, myDrop, myBlur];
You can add as many filters as you want. Below is an example of a Movie with seven Filters: Glow; Drop Shadow; Bevel; Gradient Bevel; Gradient Glow; Color Matrix and Blur.
Example: Download the Flash file Draw 219d
Flash Movie Clip with seven filters applied.
This is the actionScript for the above Movie:
// Makes all possible filters available to use in the Movie.
import flash.filters.*;// Creates variables with info about the Filter settings
var myGlow = new GlowFilter(0x000066,.7,9,9 3 3,true,false);
var myDrop = new DropShadowFilter(12,45,0x000000,.6,8,8,1,2,false,false,false);
var myBevel = new BevelFilter(7,45,0xff99ff,0.4,0x000000,0.4,16,8,5,3,"inner",false);
var myGradientBevel = new GradientBevelFilter(3,225,[0x990000,0xFFFFFF,0xFF99FF],[.3,.3,.3],[0,100,255],8,16,6,1,"inner",false);
var myGradientGlow = new GradientGlowFilter (0,0,[0xFF99FF,0xFFFFFF,0x990000],[0,.7,.7],[0,50,255],35,25,1.2,1,"outer",false);
var myColorMatrix = new ColorMatrixFilter([0,1,0,0,-80,0,0,1,0,-80,.5,0,1,0,-80,0,0,0,1,0 ]);
var myBlur = new BlurFilter(10,2,3);// Applies the filters to the object named myObject.
myObject.filters = [myGlow,myDrop,myBevel,myGradientBevel,myGradientGlow,myColorMatrix,myBlur];
|
Why not try out webwasp's new community. Meet new people, find friends in your area: Webwasp Mates & Dates
•
5400 visitors to this page since
4 April 07 •
|
|
|
All material on this site is protected under international copyright © law. DO NOT reproduce any material from this site without written permission. Please ask as permission is often granted.
|