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

Packages Part 2

Creating a package.

Video Transcript

00:00So we started with the packages and with the packages if we just go into the directory again
00:05We'll see that what we did is we created the we created in the same folder of our main
00:09We created a com folder inside of it everything FLA now the reason why we did that again is because we wanted to separate things and
00:16We've said that we might have code from different projects, but even look at my site
00:20You know everything FLA has quite a lot of projects ready
00:23We had already over 25 hours of lessons until today, and if we include this that would probably be 27 hours
00:29So how do we separate between the source codes of all these different classes if we wanted to bundle it up and send it all together
00:35In the same directory we couldn't because everything was called main
00:39So we had no way to really to separate between them because our main was all sitting in the same directory also
00:44To make that possible we're going to go into the comm directory everything FLA directory now
00:49Maybe we'll create a new folder here that would represent what we're talking here
00:53So let's say we're going to create a new folder and again
00:55I like using for packages all lowercase now everyone has a little bit different standard, but I
01:02Would never start it with uppercase you know like if you want to do camel case. That's fine
01:06I prefer not doing camel case either, so I prefer everything lowercase no spaces
01:11No underscores just all the words bundled up into one thing so we have calm that everything FLA and let's say we want
01:17to call this Oh
01:19basics
01:20And it is fine that it's not insanely readable you could if you want do camel case
01:25The reason why I don't do camel case connects back to the topics that I want to have an easy way to separate between my packages
01:30functions classes libraries
01:33Constants and so forth so let's let's talk about these before we actually finish implementing it
01:37Or let's finish implementing and then we'll start going over all the different types
01:41So if I just jump back into the folder, so we remember is calm that everything FLA dot ope basics
01:49What I could do now is I could go into my package and write calm that everything FLA all lowercase
01:54Ope basics is our name of the package now
01:59We have our packaging, but one thing that we have to do is we want to change our main location
02:03So I'm going to close this file, and I'm going to go back into the folder
02:07I'm just going to grab my file and just dump it inside of ope basics, okay, so now it's not sitting in the same folder
02:13And now that it's not sitting on the same folder
02:16I could go into my main in my flash, and I could go into the properties and change the path to my
02:23Let me just select somewhere that there's nothing on it
02:26And I could change my path to my main to be that path so that was calm that everything FLA dot ope basics dot main
02:32And now if I click on my edit button again
02:37It should take me back into my class that I just moved into a new directory
02:41So let me before I continue on and actually go down and say okay
02:44This is how I want you guys to separate or how I recommend obviously it's not mandatory
02:49You'll still be great programmers
02:50Even if you don't they'll just work in a standard that other people and you guys over time will see oh wow this
02:56It cuts a lot of time in my programming
02:58So before we go into that let's just ask a big question here is one is everything okay?
03:04Is there any questions so far or could we continue onwards?
03:16Great is our is our speed too slow too fast too, or we're just about right
03:28Fantastic and we're alerting will look rare. Why am I stuttering?
03:31We're alerting here some really really critical things that
03:34They're gonna take you on from now on and hopefully by tomorrow when you start program
03:38You're gonna look at things a little bit differently
03:41Alright, so we saw our packages and like we said we like our packages to be all lowercase
03:46So I'm gonna call it all low so all lowercase that makes it easy for us to see if it's a package or not
03:52a package

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!