It's TweenMax Time
Don't worry... although it's one of the last topics we actually covered most of the tween library feature through its plugin architecture. The topics not covered in this course are interactive control over the animation itself and deeply nested animations. These topics will be covered in our advanced animation training.
Video Transcript
00:02Another course has been completed, another chapter and another course and another
00:07Massive achievement on your end and we're gonna wrap this course up with taking a look into tween max
00:13But really you really know a lot and you really know how to work with tween max as well because there isn't a lot more
00:19That is added in because most of the features of tween max are already in those plugins that we were looking into
00:25But we're gonna see how we could create the same effect that we've done in the last video in the last lecture
00:30How could we do it with tween max with a lot less code and a lot more powerfully because we don't have to write a lot
00:35Which is always great and that covers it and we're done with this course
00:39I hope you enjoyed it, and I hope to see you in our next bundle of advanced animation lecture, which is kind of exciting for this
00:46group of chapters are
00:49intermediate learning how to animate programming in JavaScript Jake jQuery canvas and
00:56of
00:57course G-SAP
00:59Now before we wrap things up, I want us just to move into tween max and really as you can see
01:0699.9% of the power is really in the plugins and in those additions that we're putting inside and really the tween light library on its
01:13Own is incredibly powerful now
01:15Once we click on to move into the tween max
01:17We don't need to load up tween light anymore because it's gonna automatically be loaded up as well
01:22So when I go and I load decide to load tween max
01:24I literally could just go ahead here and I don't need to
01:30I don't need to basically load up a lot of these plugins. So the CSS plugin by default is loaded attribute plugin
01:37Default loaded round props plugin round props plugin automatically loaded as well
01:44So I don't need to load up basically all these things anymore because they're automatically loaded
01:49Nor do I need to load up the ease pack because all these stuff are automatically loaded up once I
01:55Put tween max instead of tween light
01:57So I'm gonna go ahead here and just basically comment out all of this code
02:01Because I don't need it anymore and instead of that
02:04I'm just gonna load up my tween max which will basically load up all that stuff that we had there before as well and just
02:10by setting this to tween max and I'm just gonna go ahead here and
02:14Save this if I go back into my application and click on refresh
02:18I don't even have to change anything for everything to continue working as it did before but that wouldn't be
02:24Really interesting if that's all what we did. So what I want to do before we wrap up this course in general
02:29I want to show you how could you do the exact same effect only using the extra features that are available in tween max
02:36Now beyond the extra features that are available in tween max that are let's do them. Let's do them
02:42let's do them so first of all what I'm gonna do is I'm just gonna come right in here and
02:45What I'm gonna do is I'm gonna go ahead and just comment out all of these extra
02:49Stuff that we've added here because we just don't need them once we're using tween max
02:54I could literally have all this stuff automatically
02:58Happen without needing all of this because literally all I have to do is do use a few properties
03:04one is repeat
03:06The repeat property if I add that in once I'm in tween max and I set repeat
03:10I could set a value of minus 1 which would mean that there would be a repeat forever
03:15And if I set it to minus 1 go into my application click on refresh
03:18We're gonna notice something very interesting one is like one is the repeat is basically happening
03:24Oh, I might have your little error here repeat minus one should happen forever
03:30and
03:31It's happening forever, but we're not seeing it. So let me just save that go back in here click on refresh
03:37hopefully now it's gonna work so we have your one and
03:40Oh
03:41Right, right, right, right, right my bad. I'm still working with tween light. I have to move up to tween max
03:47I'm gonna go ahead here now that we're using tween max only attributes
03:51I'm gonna have to bump up to the tween max and by the way, I could still use the tween light in other places
03:56That's completely fine because it automatically have has both so you could choose when do you want to use tween max in general?
04:02If you're using tween max, you already have it loaded up. Just use it always it's probably gonna be more convenient
04:08But there is you could use both at the same time. There is no problem with them
04:12And now that I set it to be tween max
04:14I could go ahead inside here click on refresh and this time around we should see that it's gonna happen over and over and over and
04:20Over now we could also add a few more kind of fun things as we could add also a repeat delay
04:26Now even before I add the repeats delay, I'll just talk about this for a second now
04:30We're doing it forever
04:30But if I set it to zero then it's gonna do it once if I set it to one then it's gonna do it
04:35Twice so if I go ahead here and click on refresh, we're gonna see that now it's gonna happen once
04:39It's gonna happen twice and then it's gonna stop
04:41And if I wanted to match up to the amount of times that I had before I would probably set it to three and
04:47Setting it to three is gonna give me exactly that one two three
04:51Now the only difference between this and the last animation that we had
04:55Oh by the way, this was four because it includes the three
04:57So if I wanted it to be three times, I would set it to be two
05:01But in our case, I think that's the last time we did a three. So that's fine
05:04We'll keep that through which is basically four times now beyond that four times
05:08Repeat the diff big difference in this and what we had before is that this is only going forward
05:13It's the regular animation one two three four
05:16It's not going reversed
05:18But even before that how about we'll add a feature that we didn't have before which we could have created on our own
05:24But it's a lot smoother a lot faster by just adding a delay repeats
05:30Delay and I could literally just come here and say okay
05:33I want a delay of one second between repeats and by setting that up now I'll have here the one
05:37it's gonna wait for a second gonna do the next one wait for a second and so on and so on and
05:45Last but not least and this is really what covers and completes this course
05:49Really is our option of adding a yo-yo effect and by setting yo-yo true
05:55I'm basically saying I want to animate forwards and backwards just like we had before we were playing or
06:02Reversing now, it's gonna happen for me automatically and automatically set it back and forth back and forth
06:07Only you'll have to know that this repeat is only happening three times
06:10Which means it's gonna be one and a half times those yo-yos. So in this case, we're gonna have one
06:17Two three
06:21Four because it's zero one two three and then it's gonna stop and it's not gonna do it actually
06:27The amount of times I wanted to do so in this case really what I wanted to do and maybe set it four times
06:32Which is actually five times and that will make sure that it's gonna come out also in its last iteration
06:37So if I go ahead here and just click on refresh here
06:40We'll have that in out in out
06:42Scenario until it goes back and and that's really the small difference because our counter was counting only wants a full cycle of back
06:48And forth was going on but we could have very easily created this effect on our own
06:53But it would demand us to write that code ourselves
06:56So that's really it and really when when you're talking about these stuff
07:00And I'm just gonna go ahead into the tween max this time around just to show you
07:03There really isn't a lot more extra properties that you need to worry about
07:07oopsie I went into the wrong one in tween max and really a lot of the extra features relate to
07:13controlling time and interactive animations that could pause and play and
07:18Those are the things pause play move around seek and a lot of other fun things like that that we're gonna be covering
07:23In our advanced course as we create a lot more intricate animations that interact with each other and so far our animations kind of work
07:31On their own if in chapter number if our first bundle of courses was about learning how to code our second bundle of courses here is
07:38about learning how to animate which is what we're at right now and our third bundle of courses is about how to animate in
07:45animations that interact with each other that have complex timelines and really that's where between max is gonna come into play and that's where
07:53Timeline light and timeline max are gonna come into the play because we're gonna be able to leverage them and use them to create a lot more
08:00intricate animations or from the depth and control we have over them or from the level of having
08:06Animations interact with each other and that's really gonna be that big topic of our advanced course
08:11But in general, I just wanted to kind of talk about a one more small thing is when you're looking at the at the events
08:17You have very similar events
08:19The only thing is you have also an extra event of on repeat and on repeat complete
08:23basically on repeat which will basically enable us to count the amount of times that a repeat happens and
08:28That wasn't that didn't exist in the tween light
08:30So if I wanted to create some sort of a time or I wanted to do something each time a full repeat cycle
08:35Happened that I could go ahead and add this event and get that triggered whenever a repeat
08:41Happens or by the way, this is on repeat
08:45Unrepeat
08:48We have on complete we have on repeat we have on reverse complete we have on start we have on update
08:55Which is one we've seen already before
08:57And literally so that's really just the only extra one which is the function that should be called each time the animation repeats
09:03And literally every time a new repeat happens each time a call to repeat happens
09:08It would be called which is very similar to on start it would only be happening on repeat
09:12So you like it just to make it really really really really really clear before we wrap up
09:16I'll show you on start and on repeat just to see when are they actually going to be triggered?
09:21So if I go ahead here, I'm just gonna
09:24create here another on start and
09:26I'm gonna call this on max start and I'll just create here really quickly also on
09:33repeat
09:34I'll call this on max repeat
09:40And I'll just go ahead here and
09:44I will quickly create these functions or slowly
09:53Go ahead here and copy it. Oh, let me do it to the console console log
09:59Start and
10:01I'll just copy this
10:03Set here also the on max repeat
10:06And if I go ahead and save this and just watch what's happening in my console
10:17You'll see that on the beginning when we first started and have your little error here
10:21so let me fix it line 20 which basically means to me that that that I didn't put a comma here and
10:27And let's try this one more time
10:30So we see that we have here the on start as soon as we started and every repeat every time another repeat happens every time
10:37Another cycle starts it's gonna call the on repeat because on start is just called once
10:41It's not being called every single time a cycle happens and the on repeat just happens
10:46Basically every single time an animation starts that isn't the first animation. All right, so that's it
10:53We are completely done with this course and completely done with this whole cluster of
10:58Chapters and I hope to see you in our next bundle, which is going to be about advanced
11:03interactive animations where we're gonna
11:04Explore in depth a few things that we didn't touch in tween light which were more related both to pausing and playing and although you
11:11Could do them yourself and I encourage you to do them yourself
11:13We're gonna take them to the edge and show you how to really take advantage and do really cool things with it
11:18So we'll hopefully see you in the next
11:20Bundle of courses
