Adobe Flash Tutorial - Dynamic Blur
Hey guys, this is MA1. Today, I'm going to be doing a tutorial on how to add dynamic motion blur to an object in Flash.
So, I'm going to be using ActionScript 2. As usual, I'm going to start by drawing a shape and converting it to a movie clip. Um, convert it to a movie clip by either pressing F8 or by right clicking and going to "Convert to Symbol" and then making sure that the type is "Movie Clip" and press OK.
So next, you're going to want to open up the actions for the root layer. So either press F9 or you can right click and go to "Actions." So, first of all, I'm going to want to import the blur filter: import flash.filters.BlurFilter
.
A lot of things are automatically imported by Flash, but the blur filter is not one of them. So now, I'm going to want to make a new blur filter. So, var blur:BlurFilter = new BlurFilter();
And then here we have the parameters.
We have blurX
, which is how blur it will be horizontally; blurY
, which is how blur will be um, uh, vertically; and the quality, which determines the uh, I guess the resolution of the blur map or something. So, I'm going to do 5, 5, and 4.
For right now, this doesn't really do anything; we just have a uh, a filter here. And so now, um, first to apply it, I'm going to need to add an instance name to this movie clip. So, I'll click the movie clip, name it "ball," and then I'm going to go back to the actions.
So now I'm going to do ball.filters = [];
and then I'm going to name it. I'm going to use blur
. Um, filters of a movie clip is always an array, so you need to add it to an array. I think if you did it with only blur
, it wouldn't work.
So, let's test our thing, and it should work. As you can see, the object is blurred now. So, uh, you can, I guess you can change the things around. Say, if you want to have an object that's moving very fast in a certain direction, you can have it, uh, have it a 10 blurX
.
So, yeah, you can mess around with this; you can change the settings. So, thanks for watching MA1, subscribe, and goodbye.