Use the BlurFilter class to construct the image blur effect

Source: Internet
Author: User


// Import the BlurFilter class
Import flash. filters. BlurFilter;
// Define a BlurFilter. The numbers in the BlurFilter represent the number of _ x, _ y, and the number of fuzzy operations.
Var my_BlurFilter: BlurFilter = new BlurFilter (10, 10, 2)
// Add a filter using an array
Var my_Array = new Array ();
My_Array.push (my_BlurFilter );
// Assign the filter BlurFilter to MC.
My_mc.filters = my_Array;
Here, you need to remove the BlurFilter class method:
My_mc.filters = null;

The code is as follows:

/* ---------------- Http:// ------------------*/
// Fixed the size of the Flash content, so it remains unchanged even when the player window is changed. If the player window is smaller than the Flash content, some cropping may be performed...
Stage. scaleMode = 'noscal ';
// Import the BlurFilter class
Import flash. filters. BlurFilter;
// Define the amount of horizontal blur
Var blurX: Number = 10;
// Define the vertical blur volume
Var blurY: Number = 10;
// Define the number of fuzzy attempts
Var quality: Number = 2;
// Define a BlurFilter class
Var myBlurfilter: BlurFilter = new BlurFilter (blurX, blurY, quality );
Var filterArray: Array = new Array ();
// Add the blur effect
FilterArray. push (myBlurfilter );
// Define the blur effect of myPic_mc
MyPic_mc.filters = filterArray;
// When the mouse moves up, clear the filter.
OK. Onrolover = function (): Void {
// Clear the filter
MyPic_mc.filters = null;
// Continue to blur when the mouse is removed
OK. Onrolout = function (): Void {
MyPic_mc.filters = filterArray;

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.