|
||||||||||||||
. . . . . |
Apply Bevel Filter to MovieClip in Flash 8
Using actionscript to change and apply filters to movieclips in Flash 8 is a nightmare.
Flash Tutorials in Video Format -
Watch them now at LearnFlash.com
Here is some code to show what I mean. I have a button called bevel_btn and a movieclip called square_mc
bevel_btn.onRelease = function(){
// create a filter from the filters.BevelFilter constructor
var myBevel = new flash.filters.BevelFilter();
// create a temporary array to apply filter to
var myTempFilters:Array = square_mc.filters;
// push our filter to the temp array
myTempFilters.push(myBevel);
// copy temp filters to our movieclip filters
square_mc.filters = myTempFilters;
}
You can use this algorithm to apply all the other filters such as BlurFilter, GlowFilter, DropShadowFilter. var myBevel = new flash.filters.BlurFilter(); var myBevel = new flash.filters.GlowFilter(); var myBevel = new flash.filters.DropShadowFilter();But just change myBevel to what you want. e.g. myBlur, myDrop, myGlow. Of course the default constructor uses the default settings. So if you want to set your own values, you will have to set them in the constructor when calling it. .e.g. var myBlur = new flash.filters.BlurFilter(50,50,1);The constructor parameters for BlurFilter are blurX, blurY and quality.
For the BevelFilter constructor,(yes I know it is hideous) it goes as follows: Flash 8 Resources. . |
|
||||||||||||
|
. | Home | Flash MX | Actionscript 2.0 | Flash 3D | Flash 8 | Flash Database | Flash Mobile | Flash CS3 | Java For Kids | Video Course | General Video | Photoshop | Web Design | Digital Photography | Games | free backgrounds | Resume | Streaming Video | Students Work | Links | Contact me | sitemap | reviews | . . |
||||||||||||||