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

Aligning stacked animations

When adding a pile of animations into the timeline at the same time, there are a few ways to change the way they are stacked into the timeline. In this lesson, we will explore how to change the way items are stacked against the timeline when added together using the align property.

Video Transcript

00:00All right, so the next property I wanted to talk about is the Align property. Now the Align property
00:06enables us to change basically the way this relationship between the tweens and the stagger
00:12work or how tweens in general work. Now to activate this what I really need is for my tweens
00:18to have some sort of a delay. So I'm going to go ahead and add a delay, go ahead and add a delay
00:26of one second into my tweens. Now by doing that automatically by default tween light is going to
00:34actually respect that delay adding another one second delay between each animation. So you can
00:40see each animation begins in a delay with a delay of one second but you don't really see it that
00:47noticeably because by default all these animations are happening at the same time because they're
00:52staggered. So although they're staggered and there is also another delay, although by default it's
00:58going to respect it, it's not very visible. So let's make it a little bit more visible and
01:04let's do this only for our initial animation of our actual header or our logo copy and I'm just
01:12going to put here another property for our actual timeline light and that property is going to be
01:18align. Now the align, align and the align property could have a few options, they're strings.
01:25One is normal which is the default so I'm not going to do that. The other is start and start
01:32basically is going to make sure that everything starts at the same time plus it ignores the delay.
01:39So if I put here start then we won't see the delay at all. So if I run it now we won't have
01:45even that initial delay so we're probably going to have to run it twice for us to be able to really
01:49see it. So we're going to run it once you could see that it's all coming in at the same time,
01:53there is no delay between the animations besides that staggering that we're creating. On the
01:59other half if we just get rid of that align or put inside of here the value of normal
02:05which is the basic, this the default, if we do that and we run it again and again we're going
02:10to run it a couple of times so you could really notice it, you'll see that everything is just a
02:14little bit slower. So if I run it one more time you'll see that there's a one second delay
02:19that made everything come in a second later. So again you'll see that it's standing there for a
02:24second and then it's running in contrary to our normal. Now the one last option is sequence.
02:31Now sequence it works a little bit differently and let me make sure that I'm typing sequence
02:36correctly. S-E-Q-U-E-N-S-E well N-C-E oopsie. Don't read out loud if you're a dyslexic person,
02:45note to myself. And if I run it one more time now sequence as the name implies the animations
02:51are only going to happen one after each other for our initial item. Okay so that's the alignment
03:00and you can literally play with your alignment and decide which alignment works better for you.
03:06Now before we wrap up this topic completely well actually this is it. This is the question
03:12of sequence and you could set this and this is only only refers to the tweens that are initially
03:18in there. So every other tween you add later is going to have the default configurations.
03:23So literally the play between tweens, stagger, and align are going to be the properties that
03:29are going to help you decide how do you want to create your animations. Really in my case I
03:34don't really need this delay so I'm just going to get rid of that extra one second delay
03:38because I want to control all of that using that stagger effect because it's going to be a
03:43lot more effective. All right and a lot easier to control so I could create a stagger for this
03:48that is different from the stagger to that so this might be slower and this might be a little
03:53bit faster. So maybe our main tagline is really slower while our while our inner copy is running
04:02in a lot faster that way maybe when we finish that one the other one will almost complete as well.
04:07All right so that's it about about this topic and I'm going to have one more kind of like main
04:13topic and you know what let me just add one more thing because we are more or less done
04:20with talking about these properties the default properties. I want to talk about just one more
04:25which is called auto remove children and I want you to see it in action so auto remove children
04:34and I'm just going to save it and run my application one more time and when I set up
04:42auto remove children what I'm actually removing I'm not removing my item from the stage I'm
04:48removing that animation. Now if I why would I do something like that it could be that I want to
04:53start now another animation and use the same timeline or I just want to clean up my memory
04:59because this animation is only going to happen once I'm not planning on reversing it ever again
05:03so I don't need those tweens anymore so by setting auto remove children I'm basically getting
05:08rid of the tweens that I don't need anymore. Now if you're planning on creating another
05:13animation with it or backgrounds and forwards animation and such which we're going to probably
05:17look at later down the line we're going to talk about tween max a timeline max then you
05:22probably don't want to remove the children all right so that's really more or less all we're
05:26going to talk about the properties there's a few more properties which you could explore on your own

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!