|
||||||
|
||||||
Create a Gradient Glow Filter with ActionScript

Free
Flash Tutorial
Step Two: The ActionScript
Note: With Script Assist on you cannot type in the Actions Panel. If you want to learn more about Script Assist see the tutorial on the Actions Panel
// Makes the filter available to use in the Movie.
import flash.filters.GradientGlowFilter;// The Arrays (lists) below must all have the same number of entries.
// Lists the colors to use in the Gradient.
var colors:Array = [0xFF99FF, 0xFFFFFF, 0x990000];
// Sets the transparency of each color.
var alphas:Array = [0.5, 0.4, 0.3];
// Set the position of each color.
var ratios:Array = [0, 50, 255];// Creates a variable with info about the Filter settings.
var myGradientGlowFilter = new GradientGlowFilter (0, 0, colors, alphas, ratios, 35, 25, 1.2, 1, "outer", false);// Applies the filter to the object named myObject.
myObject.filters = [myGradientGlowFilter];
Note: It is possible to write this code in a more compact form. The Arrays do not need to be separated out but can be directly included in the parameter settings. I prefer to spread it out as it is easier to edit. But if you wish you could write the code like this:
// Makes the filter available to use in the Movie.
import flash.filters.GradientGlowFilter;// Creates a variable with info about the Filter settings.
var myGradientGlowFilter = new GradientGlowFilter (0, 0, [0xFF99FF, 0xFFFFFF, 0x990000], [0.5, 0.4, 0.3], [0, 50, 255], 35, 25, 1.2, 1, "outer", false);// Applies the filter to the object named myObject.
myObject.filters = [myGradientGlowFilter];
|
Why not try out webwasp's new community. Meet new people, find friends in your area: Webwasp Mates & Dates
•
7078 visitors to this page since
28 March 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.
|