How do we make an item glow during runtime? or change its shadow? The flash movie below shows mouse over effects that apply filters on a flash movie during runtime using actionscript.
Our source is extensively documented explaining each line and what every function does. It also explains variations and what each variable represents. By downloading you get quality, specific source code that can be used, re used, with technical support.
Download FLA Source File with AS3 Filters: $3
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 | Here is the source code:
/**
* Using Actionscript Filters
*
* Version: 2.0
* Author: Avraham Saltoun
* URL: http://www.say-web.com
*/
/*
Available Flash Filters
(for detailed filter infomation, highlight the filter name and press F1)
BevelFilter
BitmapFilter
BlurFilter
ColorMatrixFilter
ConvolutionFilter
DisplacementMapFilter
DropShadowFilter
GlowFilter
GradientBevelFilter
GradientGlowFilter
*/
//import the filters we are going to be using otherwise an error message is given
import flash.filters.GlowFilter; //The GlowFilter class lets you apply a glow effect to various objects in Flash. You have several options for the style of the glow, including inner or outer glow and knockout mode. The glow filter is similar to the drop shadow filter with the distance and angle properties of the drop shadow set to 0.
import flash.filters.DropShadowFilter; //he DropShadowFilter class lets you add a drop shadow to a variety of objects in Flash. You have several options for the style of the drop shadow, including inner or outer shadow and knockout mode.
import flash.filters.BlurFilter; // The BlurFilter class lets you apply a blur visual effect to a variety of objects in Flash. A blur effect softens the details of an image. You can produce blurs that range from a softly unfocused look to a Gaussian blur, a hazy appearance like viewing an image through semi-opaque glass.
import flash.filters.BevelFilter; //The BevelFilter class lets you add a bevel effect to a variety of objects in Flash. A bevel effect gives objects such as buttons a three-dimensional look. You can customize the look of the bevel with different highlight and shadow colors, the amount of blur on the bevel, the angle of the bevel, the placement of the bevel, and a knockout effect.
//Setup Glow Filter parameters
var glow_color:Number = 0xFFFFFF;
var glow_alpha:Number = 0.8;
var glow_blurX:Number = 25;
var glow_blurY:Number = 25;
var glow_strength:Number = 2;
var glow_quality:Number = 3;
var glow_inner:Boolean = false;
var glow_knockout:Boolean = false;
var filter_glow:GlowFilter = new GlowFilter(glow_color, glow_alpha, glow_blurX, glow_blurY, glow_strength, glow_quality, glow_inner, glow_knockout);
//Setup Shadow Filter parameters
var shadow_distance:Number = 10;
var shadow_angleInDegrees:Number = 45;
var shadow_color:Number = 0x000000;
var shadow_alpha:Number = 0.8;
var shadow_blurX:Number = 16;
var shadow_blurY:Number = 16;
var shadow_strength:Number = 1;
var shadow_quality:Number = 3;
var shadow_inner:Boolean = false;
var shadow_knockout:Boolean = false;
var shadow_hideObject:Boolean = false;
var filter_shadow:DropShadowFilter = new DropShadowFilter(shadow_distance, shadow_angleInDegrees, shadow_color, shadow_alpha, shadow_blurX, shadow_blurY, shadow_strength, shadow_quality, shadow_inner, shadow_knockout, shadow_hideObject);
//Setup Blur Filter parameters
var blur_blurX:Number = 10;
var blur_blurY:Number = 10;
var blur_quality:Number = 3;
var filter_blur:BlurFilter = new BlurFilter(blur_blurX, blur_blurY, blur_quality);
//Setup Bevel Filter parameters
var bevel_distance:Number = 5;
var bevel_angleInDegrees:Number = 45;
var bevel_highlightColor:Number = 0xFFFFFF;
var bevel_highlightAlpha:Number = 0.5;
var bevel_shadowColor:Number = 0x000000;
var bevel_shadowAlpha:Number = 0.8;
var bevel_blurX:Number = 5;
var bevel_blurY:Number = 5;
var bevel_strength:Number = 5;
var bevel_quality:Number = 3;
var bevel_type:String = "inner";
var bevel_knockout:Boolean = false;
var filter_bevel:BevelFilter = new BevelFilter(bevel_distance, bevel_angleInDegrees, bevel_highlightColor, hbevel_ighlightAlpha, bevel_shadowColor, bevel_shadowAlpha, bevel_blurX, bevel_blurY, bevel_strength, bevel_quality, bevel_type, bevel_knockout);
//Setup buttons that control the filters
but01.onRollOver = function (){
//apply a glow filter to a movieclip name adobe_flash
SayWebLogo_mc.filters = [filter_glow]
}
but02.onRollOver = function(){
SayWebLogo_mc.filters = [filter_shadow]
}
but03.onRollOver = function(){
SayWebLogo_mc.filters = [filter_blur]
}
but04.onRollOver = function(){
SayWebLogo_mc.filters = [filter_bevel]
}
but05.onRollOver = function(){
// setup multiple filters for one movieclip like so:
SayWebLogo_mc.filters = [filter_glow, filter_blur]
}
but06.onRollOver = function(){
// reset or remove filters like so:
SayWebLogo_mc.filters = []
} |
.






8 Responses to “Apply Filter Effects on Movie Clips using Actionscript 3.0”
Trackbacks/Pingbacks
best approach to re-writing, of course, is…
to find someone else, someone with a critical eye and a tough skin, to read and mark and criticize what you have written. bear into that criticism. change what is recommended. alter your approach. try it again. revising and editing your…
based on the keywords, the search engines…
determine the rank of your website. higher ranking obviously helps in generating more traffic to your site, facilitating your online business. now, to create a professional and relevant matter for your site it is essential to take help of specialized s…
in business administration is continuously growing in…
demand for many have seen its endless benefits. the primary purpose of getting an mba degree is to enhance the student’s full potential and to boost the student’s unexplored managerial skill. although there are hundreds of other more college courses …
and interesting content, just to have it…
exist unread in cyberspace, but chances are your first few posts will go unseen until you have established yourself as a good quality, trustworthy, blogger.how does a person establish themselves as a quality blogger? you can help establish yourself by …
small service business owner you want to…
bring in more of the right kinds of clients. you’ve been told that facebook is good for growing your business but you have to know how to use it. i’ve had my clients tell me they constantly do updates on facebook…
writing a post is that the important…
information is covered first.some readers might not want to read till the end if useless information is shared in the beginning. there should not be fancy words used instead the post should be in a simple, easy to understand language.one thing…
than 3-4 fonts on any one page….
don’t change the font in mid sentence unless you have a very good reason. sans serif for online, serif for print. monospace for typewriter and code script and fantasy for accents only. if you are new to blogging you are probably…
you may even find it helpful to…
simply sit back or take a walk to think of how best you can word what it is you want to say!pull your head out of the sandas a blogger you will likely be creating content quite regularly (hint,hint) but it…