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

Adding a label to it

Although you may add a timeline label in TimelineLite, it doesn't have many features. Once we move into TimelineMax, we are introduced with a lot of features making labels a lot more pliable. In this lecture, we will explore labels and see how they can be leveraged.

Video Transcript

00:00Chapter eight, labels.
00:03So let's get through, let's see how it is.
00:05It's really simple, I'm still on my timeline light.
00:08I'm gonna go ahead to my timeline main here
00:10and I'm gonna go into it and I'm gonna say to it,
00:13I want to give it a label.
00:16I'm gonna add a label, oopsie,
00:19and I'm gonna give it a name, I'm just gonna call it logo.
00:21Now what this does, it just puts a label
00:24after all this other stuff that are happening up here.
00:27So now I have a position in time
00:29where I could actually reference to more easily.
00:33Now once I have a reference point,
00:34I could go ahead and tell my TL main
00:37that I want it to pause, add a pause.
00:41And where do I wanna pause?
00:42I wanna pause in logo.
00:44I'm gonna put here, by the way, also a number,
00:46but I'm gonna put the logo,
00:47I'm just gonna cancel this tween
00:48because this tween is gonna override our pauses
00:51because it's taking control over everything.
00:53This is, the tween light is actually running the animation
00:56and not our timeline light.
00:58So I have to kind of like undo this tween light.
01:01And once I've added this pause in,
01:02I could run my application.
01:04And if we give it a few seconds for it to run through,
01:07we'll see by the end of it, it will stop
01:09and it's not gonna continue animating out
01:11the way it would have
01:12if we would have it running without this pause.
01:15Now beyond this pause that we've added to it,
01:18which by the way, the pauses that we're not continuing
01:21all these fades out that we had here
01:22that we added in the last lecture,
01:24we could also get very easily
01:28the actual time of that pause.
01:30So for example, if we wanted to get that TL main
01:34get label time, we could send in our logo
01:39and literally just get that position in time
01:42when that fade is gonna happen,
01:43when that pause is gonna happen,
01:45which will happen at a second 11 and 20 milliseconds.
01:49So that's all you really could do
01:50with labels and timeline light.
01:53I wanna quickly just show you what you could do
01:55if we had your timeline max,
02:00let me just make sure that it's imported.
02:04And I'm gonna go ahead and just switch our creation
02:06to be a timeline max.
02:08And now that we have a timeline max,
02:10you'll see that we'll have a few other traces
02:11of a few other properties
02:13that could come and become really handy,
02:15such as current label,
02:17that we can or set the current label
02:20if we wanna jump to a specific spot
02:22or get the current label.
02:23So for example, instead of doing this pause,
02:25I could, or on top of that,
02:27I could literally just go to that specific spot
02:30and jump to that specific spot.
02:32And if I didn't have a pause position in that spot as well,
02:35and I would just jump to that layer,
02:37I would just animate from that point onwards.
02:41Okay, so literally that's it.
02:45So that's it, there's one more.
02:47Oh, you know, let's talk about a couple more quick,
02:49quick, quick, quick, quick, quick, quick, quick, quick things.
02:52So by the way, we didn't have to have your trace as well
02:55because we literally went ahead
02:56and just set our label.
02:59And I'll do here a quick trace TL main
03:01to show you a few other things you could do with labels.
03:04One is to get the label before a certain spot in time
03:08or get the label after,
03:10yeah, get label, label after or before,
03:14which is only available in timeline max.
03:17So you see there's a lot of,
03:18and also you could get your label array.
03:20So you have your like a nice amount of extra features
03:22that enable you to create more interactivity
03:25with your labels if you're using the timeline max.
03:28And again, in general, most of the stuff
03:30that are really critical,
03:31you find in the tween light and in the timeline light
03:34and the tween max and the timeline max
03:36just add extra features that are just not there by default
03:40to make it a little bit easier on you,
03:42but adding a little bit more of a footprint
03:44or a lot more of a footprint onto your application.
03:47So that's it.

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!