02Geek HTML5 and JavaScript, TypeScript, React, Flash, ActionScript online School
Previous VideoNext Video

Things are getting Blurry (BlurPlugin)

In this chapter we're reviewing different plug-ins of the TweenLite Library. In this lesson, we are taking a deep look into the BlurPlugin.

Video Transcript

00:00Chapter four we're continuing. We're still with tween light, but we're getting very close than the tween light
00:06Although there's a lot more things you could discover mainly through plugins
00:09Alright, so the next plugin and by the way all again all these plugins are absolutely relevant to tween max as well
00:15So tween max will be a much lighter conversation. No pun intended. So I'm going to import now the blur as we promised in the last
00:23lecture and
00:25I'm gonna go for the blur filter plug-in and again
00:29I have to activate it because I'm only working with tween light and again if you forgot tween nano
00:34Just does not support any of these plugins and also you cannot use tween nano if you want to use the plugins
00:40All right. So now that we got that sorted out what I want to do next is I want to create also
00:44Maybe a blur into position. So I'm gonna tween light
00:48From and I'm gonna go for our MC logo again, and I'm gonna set a duration of let's say
00:553 seconds and
00:57I'm gonna set my flash of all not flash bars my variables of my blur and I'm gonna set also a blur
01:05Filter and I'm gonna put put your slider an object and this object is gonna have a blur X
01:11With the value could be any value you want really from 0 to I believe 36
01:16But it might be more than that. It's but ideally by the way you want to put inside
01:20It could be much more than 36, but ideally you want to put inside of values that are
01:23Divisible or like duplicated to so that means you have two four eight
01:3016 and so on and so forth so two times two times two times two
01:33Those are the duplications you want to create because they'll be the most efficient because computers work on zero one
01:39So it's gonna make your probe your animation is much more smoother, especially if you have a lot of animations going on
01:44So I'm gonna start from the blur of 32 for my X
01:47And I'm gonna do the same thing for my Y. So I'm gonna go for blur Y. Oh, it's not blue X
01:53But blur X and I'm gonna do for my Y. Oh, so 32 as well
01:58Not gonna have any well, I'm gonna put here a slight delay. No, no, no delay. Yeah delay
02:03We're gonna put here a delay of zero dot to just to get and give the user a
02:08Millisecond to focus their eyes on their animation and then for a half a second
02:12It's gonna animate meaning that our logo should be visible without have going through any change for about a half a second
02:18And then I'll start animating. All right, that sounds just about right
02:21So if I run this, let's see if it works. First of all, I see that I have her a couple of errors
02:25Let me fix them really quickly. So first of all, I see here that I have your syntax error
02:30So let me just try to find it
02:31So these happen all the time and by the way was an odd thing is that I'm seeing an error in a place
02:37Right and change anything when I actually was changing line 22 21
02:41So what I what I'm noticing is I forgot to close my round bracket. I've been very bad
02:46So I'm gonna close that and run my application one more time
02:49And and first of all what I'm seeing is is that I don't see any
02:53blur really happening, which is kind of
02:58Nerve shaking so blur filter that's about right that I activate the blur filter I sure did
03:05And I'm asking it to animate from 32
03:08Now my problem is is because there is no blur at all on the object itself right now
03:13Then nothing is happening
03:15So if to fix this problem what I'm gonna do and let me just comment out everything so we could just focus on that blur
03:22That's supposed to happen for 0.3 seconds and we could see that nothing is happening and let me just change it to 2
03:28So you could just look at it and kind of test it out and figure out what's going on
03:32So first of all, we could see that when we're doing a 2
03:37Works perfectly. So if I run this one more time
03:40Our blur is working exactly as we would want it to but if we're setting a from
03:45Then our problem. Well now it is working
03:48So it seems like that we were having a very weird problem when we were at where I now when our animation was too short
03:54It was just oh I can see oh because I was publishing it too quickly
03:57But this is exactly the type of animation I wanted it to happen to have like some sort of a dramatic entry
04:03Perfect. This is exactly what I wanted
04:05So it was just I was publishing it and it took my computer a second too long to actually process
04:10I actually missed actually seeing it. So I'm just gonna add you're even a bigger delay
04:15and
04:16we could reactivate all the other animations that we had going on and hopefully now we should see everything and
04:22There we go. So our animation we first blur into position really quickly and then we fade out
04:29now obviously our animation right now is kind of lame because
04:33When we're rolling back in now that we had that blur the lines are too clean as we're zooming in
04:38We would expect that our vision to become a bit more blurry in the process
04:42And we could very easily fix that by just adding inter animation as we're scaling our X and Y to add Oh to a blur
04:49So again, all I have to do is just copy that blur filter into that area
04:54And by the way, you saw that you noticed how once in a while I have a bug or have a problem
04:59I don't believe in over editing maybe because you're gonna confront those type of issues as well
05:03And it's good for you to see how to deal in those situations
05:07So what I've done is I've just added and I'm just gonna make sure that I uh
05:12Closed every everything correctly
05:14So what I'm what I've done is I've just added a blur of eight and again, we're using those duplications of two
05:18so two on the third and
05:21We're expecting the animation to get a little bit blurry as it's coming in our direction
05:26Now if it's not blurry enough for you, which it might not be blurry enough then notch it up
05:30You can notch it up to 16. Of course, you could notch it up less than that
05:34But preferably if you could find an animation that's sitting in that sweet spot in that sweet value between
05:41Two four eight sixteen thirty two sixty four hundred and twenty eight and so on and so forth
05:46That is gonna be your best option because it's gonna create the most smooth animation because the computer is gonna need less processing
05:53So that that's it. So I'm happy with that blur
05:56I'm happy with that positioning of that blur because it seems that 16 feels the most natural and
06:04There we go. Now. I personally don't like the speed of the animation now
06:08So personally I would I would actually make my speed a little bit faster
06:12So I would even go notch it down to maybe zero dot eight, but this is already really small
06:16You know finicky finicky things because I don't want people to be able to focus too much on the graphic itself as it's animating out
06:23And I'm kind of happy with this. I would even make it faster to be honest, so I would even
06:29Set it to be maybe zero dot seven and personally
06:32I would personally even change the color of the screen
06:34But if I'm ready if we're on a roll, you know
06:37This is a good a good point to say this if we're on a roll a lot of the best
06:41Animations happen without any animation at all. And what I mean by that is for example, if we had here a new scene
06:48And I'm gonna have here an on complete
06:50I'm gonna call a function
06:53Let's say show
06:56Part one
06:58Let's say and I'm gonna go and create that public private private bits function show part one
07:06All right, so I'm creating show part one what I'm gonna do
07:09I'm just gonna flat out just to draw a rectangle and fill the whole screen with it just to show you how
07:14Smoothly you could create these really really intricate transitions that are incredibly simple
07:19And it's really just cheating the user's eye where you could throw inside new information without the user noticing
07:24So I'm gonna create a shape really quickly
07:27Not a shader and I'm gonna just go to my shape itself. I'm gonna draw a new rectangle
07:38So I'm gonna set its color fill color
07:41begin
07:42Begin fill and I'm gonna give it a color. Let's give it a really dark color
07:47So I'm gonna go for black and I'm gonna my shape and I'm gonna draw a rectangle really quickly
07:58Draw a rectangle gonna position at 0 0 stage
08:02stage width
08:04stage stage height
08:06So I'm creating a massive rectangle that's just gonna take over the whole screen and I'm gonna add that child now
08:11Obviously in your case, it might be just your actual site itself
08:15Or your actual next stage in your banner when you do these type of really simple animations tricks
08:21So as as a screen fills up and I didn't didn't actually do anything. So where is our
08:27Let me just put here a little trace to make sure that oh, I didn't do your on complete. I did I'm complete I'm
08:34complete
08:35So you see how how smoothly we're moving from a completely white screen to a completely dark screen
08:42And you could have easily create a lot of different transitions a great example
08:47That is well a lot of animations you see online if you notice that you'll have these really quick transitions
08:52They don't necessarily even have to take the whole screen
08:55But ideally they're taking 80 90 percent of your screen real estate
08:58And then you could switch things around very easily behind the scenes such as changing a scene
09:03You see that also a lot in television, but really an animation is one of the most effective ways of changing a scene without it
09:10Being very noticeable to the user and it feels very natural
09:14Alright, so that's it for this one and we have one more filter that we're gonna be talking about one more plug-in
09:20We're gonna be talking about in the next lecture before we move into our max world

Ready to Level Up Your Skills?

Join thousands of learners on 02GEEK and start your journey to becoming a coding expert today!

Enroll Now for Free!