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

Moving into TweenMax

Before we move into TweenMax, we need to understand the differences between the libraries. So, let’s explore TweenMax. This lesson is an overview of the features available in TweenMax.

Video Transcript

00:00Chapter 5, as we talked about in the last video, the chapter 5 is going to be all about TweenMax.
00:06We're going to explore the advanced features that come with TweenMax.
00:11Now before we even start talking about TweenMax, there's a few things that obviously need to know.
00:15TweenMax is just a lot larger, and in general, let's see what does that mean.
00:20What does a lot larger even mean?
00:23So to test this out, what I'm going to do is I'm going to first publish my application
00:27as is without even adding TweenLight library into our application into chapter 5.
00:33And you can see that when I run my application, I'm going to just go right there to my file here
00:39just to see what the file size actually is. And my file size is 11 kilobytes.
00:46So I'm just going to save this here just as roughly 11 kilobytes.
00:53And let's import TweenLight. Oh, we're going to do this up here.
00:59Import com rinsock TweenLight.
01:07And I'm just going to use TweenLight. So I'm just going to TweenLight.
01:11Just put it right here to make sure that it's going to get imported.
01:14And let me just publish this one more time.
01:17And if we go into our compiler, we'll see that now our output is 23 kilobytes,
01:23which basically means that TweenLight added 12 kilobytes to our application currently.
01:32So from that amount, from that 23, let's see how much more does TweenMax actually add.
01:38So I'm just going to update it to max. And I'm just going to run it.
01:44And again, go into my file. Go into my file.
01:48And you'll see that now it's 46. So it's a very, very big jump.
01:52Obviously, if we're talking just in general, we're talking about 46 minus 11, then 46 minus 11.
01:59We're basically talking about TweenMax and all in all is just 35 kilobytes.
02:05Not that big of a deal. But it really just depends on your scenario
02:09if you could or can't use that amount of data.
02:12And with that said, TweenMax comes with a lot of prebuilt stuff.
02:15And we're going to see a lot of them, such as a lot of plugins,
02:18which was our last lesson all about.
02:20So it's jam packed with plugins that are just preloaded
02:23without you needing to do anything to add them in.
02:27Now, before we finish with this intro to our chapter five,
02:30I want to prepare our surface and I'm going to need a function in this.
02:35I'm going to need an engine that could create new circles
02:38and new shapes and add them to the stage.
02:40So I'm going to go ahead and I'm going to actually go and create
02:44that function right now with you guys.
02:46And then in the next video, we're going to start playing with our animations.
02:49So let's start away. I'm going to create a new private function.
02:53And it's going to let's call it create circle.
02:56And I wanted to have one property and that property will be
02:59CLR for color. And we're going to have one property for size.
03:05Or let's do this R for radius, which would be an integer as well.
03:09And it's going to return back a shape.
03:13And all that's left for us to do is actually to create this.
03:16So I'm going to create a new shape here.
03:23And we're going to take that shape and we're going to graphic it.
03:27And we're going to begin fillet.
03:29And we're going to send in our color.
03:31We're going to assume that we're always creating a full colored
03:34element just for the sake of our samples right now.
03:37And we're going to draw circle.
03:42And we're always going to start from 00.
03:44And we're going to send the radius that we got through.
03:47And all that's left for us is to send that object back to our creator.
03:51So I'm going to return our shape.
03:55And time for us to just test this out.
03:56I'm going to add a child and just throw right in our new child,
04:00which is going to be create circle.
04:04And I'm going to give it a color, let's say of red.
04:09And I'm going to give it a radius of 50.
04:12And I'm going to assign this into a variable
04:16just so I have access to it.
04:17So I'm going to call this shape as well as shape.
04:25Last but not least, I want to position my shape.
04:27So I'm going to position my element.
04:30And there's a high probability that we're going to want
04:32to position our element, right?
04:34So let's add here some positioning values as well.
04:37So I'm going to write here x for the x, y for the y.
04:42And then we could pass through whatever we want.
04:44So I'm going to put here my stage, stage, height,
04:46the stage width, divide by 2 as the first value.
04:50And then stage, stage, height, divide by 2 as my second value.
04:53And before we send in our shape,
04:55I'm just going to make sure that I'm updating my x,
04:58updating my y.
05:00And let's give it a run.
05:01And we're going to expect to get your shape.
05:04And it's going to be red.
05:05It should have a radius of 50.
05:07And it should be in the center of our screen.
05:10So there you go.
05:11We created our function that's going to be
05:13our helper function throughout chapter 5.
05:16So let's get started.
05:17See you in the next lesson where we're going to actually
05:19start working with the new features
05:21that are available in, well, not new,
05:24but that are only available in between max.

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!