flash animation video tutorials

 

 

 

START LEARNING
FLASH NOW

Get instant access to over
45 minutes of FREE Flash tutorials on video
 and our newsletter.

Name:
E-Mail:
Phone:
Describe

.

.

.

 
Web video-animation.com

.

.

flash tutorials flash tutorials flash tutorials flash tutorials

Apply Bevel Filter to MovieClip in Flash 8

Using actionscript to change and apply filters to movieclips in Flash 8 is a nightmare.
Firstly you have to create a filter object from the BevelFilter class.
Then you have to create a temporary Array and assign the movieclips filters array to it.
Push our filter to the temporary Array.
And finally copy the temporaray filters array to our movieclip filters.
There you have it. It is horrible isn't it. But that is how you have to do it. You cannot apply the filter changes directly.

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.
Just change the constructor in the first line. e.g.


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:

BevelFilter([distance:Number], [angle:Number], [highlightColor:Number], [highlightAlpha:Number], [shadowColor:Number], [shadowAlpha:Number], [blurX:Number], [blurY:Number], [strength:Number], [quality:Number], [type:String], [knockout:Boolean])

Flash 8 Resources

.

.

flash 8