Macromedia Flash Professional 8 Unleashed
The BevelFilter Class
The BevelFilter class is designed to create bevel-image effects on objects. It is important when using this class to import it first at the beginning of your script, like this: import flash.filters.BevelFilter;
To instantiate a new instance of the BevelFilter class, use this code as a template: [View full width] var myFilter:BevelFilter = new BevelFilter(dist, angle, highlightColor, highlightAlpha,
Example: This example will create a small blue square using the drawing API and apply the filter to it: [View full width] import flash.filters.BevelFilter; //create the movie clip to display the filter var rec_mc:MovieClip = this.createEmptyMovieClip("rec_mc", 1); //move the rectangle towards the center of the stage rec_mc._x = rec_mc._y = 200; //draw a squar inside the movie clip rec_mc.lineStyle(0,0x000000,0); rec_mc.beginFill(0x397dce, 100); rec_mc.lineTo(100,0); rec_mc.lineTo(100,100); rec_mc.lineTo(0,100); rec_mc.lineTo(0,0); rec_mc.endFill(); //create the filter var myFilter:BevelFilter = new BevelFilter(5, 45, 0x00ccff, 1, 0x000033, 1, 5, 5, 2, 3,
Because the properties of this object match the parameters identically, they will be skipped. Methods
clone
Availability:2 FP:8, AS:1.0 Generic Template: myFilter.clone() Returns: BevelFilter An exact copy of the BevelFilter will be returned. Description: This method will create a duplicate copy of the BevelFilter it is called on. Example: This example will create a filter, clone it, and then walk through all the properties to see that they match: [View full width] import flash.filters.BevelFilter; //create the filter var myFilter:BevelFilter = new BevelFilter(5, 45, 0x00ccff, 1, 0x000033, 1, 5, 5, 2, 3, |
Категории