|
||||||
|
||||||
Create Flash Gradient Bevel 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.GradientBevelFilter;// The Arrays (lists) below must all have the same number of entries.
// Lists the colors to use in the Gradient.
var colors:Array = [0x990000, 0xFFFFFF, 0xFF99FF];
// Sets the transparency of each color.
var alphas:Array = [0.3, 1, 0.3];
// Set the position of each color.
var ratios:Array = [0, 100, 255];// Creates a variable with info about the Filter settings.
var myGradientBevelFilter = new GradientBevelFilter (3, 225, colors, alphas, ratios, 8, 16, 6, 1, "inner", false);// Applies the filter to the object named myObject.
myObject.filters = [myGradientBevelFilter];
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.GradientBevelFilter;// Creates a variable with info about the Filter settings.
var myGradientBevelFilter = new GradientBevelFilter (3, 225, [0x990000, 0xFFFFFF, 0xFF99FF], [0.3, 1, 0.3], [0, 100, 255], 8, 16, 6, 1, "inner", false);// Applies the filter to the object named myObject.
myObject.filters = [myGradientBevelFilter];
|
|
•
9790 visitors to this page since
25 March 07 •
|
|
|
Webwasp is Phil Schulz's baby. You are welcome to contact me or become my Facebook friend:
Click here
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.
|