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

Adding Details

In this video after we got our elements to move using the EnterFrame we are looking deeper into configuring the animation and get it it to run more smoothly.

Video Transcript

00:00Now with that said
00:02Let's see how we could actually add that a little bit more detail in our fluidity of our animation
00:07One is we know that they have different scales and these scales range between 0.5 to 2
00:14Now whatever is bigger we could assume that would move faster and whatever is smaller would move slower because it's further away in
00:21the stage so we could see
00:23More of a path of it, right? So instead of saying y plus plus plus we could say y plus equals
00:30Maybe the y scale x or scale y really doesn't matter cuz it's the same and there will be a value between 0.5 and 1
00:38And it would be different for every single clip based on whatever value it has
00:41So let's run this one more time and let's see how interesting
00:44Oh, we have your little issue of course because one of the problems that we have that there just isn't no MC oval, right?
00:50My bad because our child is this is our element. So we'd want to do is let's create here a variable and call it
00:59MC oval
01:00which will be a type of
01:02movie clip or
01:07Even better because it won't really recognize it as a movie clip. Let's see what it out what it would recognize it as so
01:14It would actually and it's just it's just a nice way to see it. It would recognize it as a display object
01:20So let's just treat it as a display object because we don't really care if it's a movie clip or not
01:24Every display object has these properties that we're playing with so we could just we could
01:30Treat it as a display object this play
01:35Object, right and it automatically fast CS5 imported my display object contain
01:40Information and all of these display elements are always in the flash dot display
01:44So it's a it's you know
01:45Even if we don't follow it
01:46You could always grab the source code if you're running in CS3 CS4 and and see where the paths are
01:53And with time you'll get used to although it's quite nice the convenience of not needing to worry about in CS5
01:59It's not a deal breaker
02:01So just grab the source code always and you can always just grab those imports and just put them in and not worry about them
02:06Until you get used to it. All right, so we know that our MC oval not over but oval will be
02:15MC oval is gonna be a type of display object and we could just set it each time before we start playing with it
02:20We're just gonna grab that value of get child out and the only reason we're doing it this way cuz we don't care
02:25It's a movie clip. We're not a source. We're not using any property of the movie clip
02:29We're really only using properties that belong to any display object. So we don't care. It's a movie clip
02:34Alright, and now we could approach our MC oval because we save the reference to and now we could use the MC oval
02:42Alright, so if we run our application one more time
02:45We should get that fluidity
02:47that's a little bit more interesting where the stuff that are closer to us are going faster and the stuff that are further away are
02:53moving down slower and they're all in kind of like this really nice motion and
02:58It was quite easy
02:59now only problem we have right now is that we kind of have an issue that our animations continue even after they're never reset so
03:06They're if I they're just continue beyond our stage area and we don't really want to have that we don't want that to happen
03:12We want them to reset or push back to above the stage area. So let's do that
03:17Let's push them up above the stage area
03:19So after we move the element we could just ask a small little if question if our MC oval
03:26Dot Y is larger than our stage height, right?
03:31stage height in
03:33That case, what do we want to do? We want to take our MC oval and we want to position it
03:39In the exact same spot that it was before and we don't want to change the X
03:43We just want to change the Y and we want to set the Y to be equals zero or a little bit less than zero
03:48To make sure that our oval is not going to be visible jumping up on top
03:52So we're going to set it to be equal minus MC oval height
03:58Because our MC oval height will just make sure that where it's like exactly the size of it is above
04:03So if we run it run run it one more time
04:06We're going to see that our movie clips always continue coming fluidly above now the longer you watch this animation
04:13You're going to see that there's a lot of repetition and obviously you want to add a little bit more
04:18Gestures into it. So for example, if we wanted to make this just a little bit more interesting
04:23We could we could now every time when our element
04:27Gets above we could do a couple of stuff one is we could reposition our X
04:31MC oval. Well, not actually. Yeah, actually MC oval
04:36dot
04:37X and we want to position in any place randomly on the stage
04:42Oopsie
04:46So we positioned it in a position random position and we want to change its size
04:55But we're going to change the size before we actually
04:58Call our change of the Y just to make sure that our size is not going to suddenly pop up and display on the stage
05:04I'm just going to grab again all this logic that we already set before
05:07Just position it just before we move it making sure that our new height is going to be what's going to be counted and not
05:13Something else so if we save this little baby and run it one more time
05:17This time around when that I may our animation starts. It's going to look a lot more a
05:23Lot more real a lot more detailed so it's harder to see where something starts and where something ends
05:28now if you're not happy with the speed you could always add
05:32some variance so you could always add a variant to this whole thing and
05:38Start playing around with it and I encourage you to do that
05:41So you could add a lot of other properties and and you know
05:44This is a very very basic motion of how you create those type of effects
05:49but I really encourage you to take this basic example and try to push the envelope with it and
05:54deliberately we're kind of leaving that to you because you've got down now the tools out of this animation just this basic animation to take
06:01It on your own and really focus on details. We didn't focus too much on details
06:05We really focus just on the basics to show you how to work work with it
06:09But we would I would absolutely personally I would absolutely love to see your own work
06:13So as you take this animation, I would I would really love also one is seeing what could you animate?
06:18Circles are probably not the only thing you could animate
06:21I've done some really really cool stuff for a lot of big companies that was really based just on this if it was banners
06:27or Kia or TV campaigns or
06:31even billboards and Times Square and
06:35They're all based on this really simple motion and and obviously
06:38Usually they you get like a week or two to work on it and you go into a lot of details
06:43What we did right now in about 20 minutes we could have done
06:46If we would do it in a week could have been really really impressive
06:50So I really encourage you to focus on those details because those details are what's gonna make you shine and what's gonna make your work
06:57stand out and although we're working on the site mainly on barebone things because we really focus on the technicalities and we're focused on
07:05Getting you up to speed with all these all these details
07:09But in future courses, we'll probably get into those details as well

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!