Flash 8.0 Tutorial: Dynamic blur Effect

Source: Internet
Author: User
Tags abs filter
Dynamic | tutorials

I drilled a flash8 tonight, feeling pretty good drop, I saw a lot of flash8 on the internet, but a lot of it will not do, the main is no train of thought, just practiced a bit of blur filter, I did a dynamic fuzzy effect, the feeling is good, is the code written too simple, but just started , first throw a brick, hoping to attract a master to make better results, but also let me wait for rookie to learn (I personally look forward to the emergence of water wave production tutorial, who to save me AH)

Here is what I have just done, everybody first look, my son oh, Handsome said (please use Player8 Watch, as if it is nonsense)

http://bbs.flash8.net/bbs/UploadFile/2005-8/200581222352550.swf

Click here to download the source file


Code plus Comment: The component name in the scene is pic//Drag MC and Hide Mouse
StartDrag ("Pic", true);
Mouse.hide ();
function to set the level of mouse movement
Pic.speed = function () {
Simple algorithm for X-distance and Y-distance
var xjl = xold-(Xold=_root._xmouse);
var yjl = yold-(Yold=_root._ymouse);
Gets the absolute value, and the subsequent move blur uses both data.
Xblur = Math.Abs (XJL);
Yblur = Math.Abs (YJL);
};
Use frame to constantly get the mouse to move the distance, hey, lazy, probably reflected the speed of the mouse
Onenterframe = function () {
Execution function
Pic.speed ();
Create a new Blur filter object
lvjing = new Flash.filters.BlurFilter ();
Dynamically set the X, Y axis blur degree of a filter
Lvjing.blurx = Xblur;
Lvjing.blury = Yblur;
Objects in the scene execute the filter command
Pic.filters = [lvjing];
};

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: info-contact@alibabacloud.com 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.