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

Why MovieClips - What's There Thing?

You probably heard before that MovieClips have Timelines but what are they and what do they enable us to do? In this video we take a break from our code as we explore for a few moments the timeline.

Video Transcript

00:00Alright, so so far we've worked with movie clips.
00:02We haven't really looked into sprites and we're going to do that really soon, but
00:06we've been working with movie clips without even doing anything really related to movie clips.
00:10So I just wanted to do something small just to show
00:13why would we use movie clips and what are they good for.
00:17Movie clips have been around since, well, since the beginning of time when it comes to Flash
00:21and
00:23speaking about time, it's actually related to the timeline, so
00:27movie clips have timelines. Let's see what that means.
00:29So, when I say a movie clip has a timeline, if we just go into our library, I'm going to type
00:34Command L to pop open our library, or you could go through your window,
00:39and we're just going to double click to go inside of my MC Oval, which is a movie clip.
00:44And inside of this movie clip, if we just hit the timeline button,
00:48we're going to see that our movie clip contains a timeline just as
00:51our root, our main scene had a timeline.
00:55So I'm just going to type, now, Command Plus, because I want to zoom in a bit, just so I could see
00:59my circle nice and big,
01:01and I'm just going to press on my space
01:04and drag with my mouse
01:06to the center of the stage.
01:08What I want to do next is I want to have a timeline that lasts
01:12thirty frames, which is
01:14a second and change, right, because we're running on twenty-four FPS.
01:20I'm going to type F6 to create a key frame,
01:22which basically means I'm going to have an animation that starts from frame one
01:26all the way to frame thirty, which is basically
01:29one dot two seconds.
01:32Now, when the animation completes, it's going to automatically cycle back to the beginning of the animation.
01:36Now, obviously, there's no animation going on right now, so let's create a really small, simple animation.
01:41To do that, I'm just going to select the center key frame, frame number fifteen,
01:45and type F6 again.
01:48I'm going to select my Transform tool, Free Transform tool,
01:51and just make the circle a little bit smaller.
01:55And I actually wanted it to be centered, so I'm not going to...
02:00I want it to be centered.
02:01Let's see how we're going to do that.
02:02Control-Shift maybe? Nope.
02:06Alt-Shift...
02:08There we go. Alt-Shift did it.
02:10And that was another great example of, like, you don't really need to remember the shortcuts.
02:13Most of them are when you're working with things on the stage. Shift-Command, out,
02:18Control, just play around with them until you find the one you want, because
02:22if you don't do it every single day, then, you know, it runs out of your head quite quickly.
02:25So I'm going to select the two frames, the two key frames,
02:29and then I'm going to Control-Click or Right-Click and select Create Shape Tween,
02:33because I have a shape on the stage.
02:35If I would have some sort of
02:37container, such as a movie clip, or a graphic, or a button,
02:41I could have selected a classic tween, but right now I want to create a
02:45shape tween,
02:46which basically will...
02:48morph my shape
02:50as it goes back and forth.
02:53For example, I might want to have, when the item goes a little bit further away,
02:56I might want to also change its color. So I'll go into the Properties panel,
03:02and let's say I'm just going to
03:04pick a darker, a little bit darker blue. So I'm going to
03:08just bear with me here.
03:14And I'm just going to drag up and down, so I'm going to drag it a bit,
03:17and create just a bit darker.
03:19So as we go in and out, it's going to just get just slightly darker.
03:24Maybe a little bit more, right?
03:26So again, I'm going to grab my end.
03:30Grab my item.
03:31We want, we can make it even...
03:33We have to select it first.
03:36So this is really changing the color.
03:39We don't really want to do that, right? That's a little bit too extreme.
03:42So let's undo that.
03:44And maybe what we could do
03:46is just make its alpha.
03:48Maybe we'll want to do the alpha, let's say 80.
03:54You saw one of my problems right now, where my shape itself, the color
03:58was already
03:59in a different color. So what I could do is I could select the color I have
04:02already on the stage,
04:04and then revisit that, and we're at 80 percent.
04:08It's a little bit tricky, but you get used to it.
04:11Alright, so here we go. So it's going back and forth.
04:15Now if we run our application just like this,
04:17we're going to see that something has changed. Now all of the different elements as they run
04:21are going to go back and forth and basically
04:24basically
04:27animate.
04:27So every single movie clip, every single item here has a completely separate
04:31timeline.
04:32Now obviously we have here a small issue where they're always
04:37kind of like breathing at the exact same time.

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!