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

Publish Settings: Source Path

As you start working with friends, code and other fantastic resources on the web a very critical element will be to understand where the actionscript classes are located and if your missing any files. To to do that, you will need to get friendly with the source path. The source path holds the key of information listing all the directories that will be used for compiling your files.

Video Transcript

00:00Now the last thing I want to talk about before we actually start building out our first class
00:06is I want to make sure that your settings are configured to be as my settings.
00:11Now, by default they will be. Now by default, and I want to show you how this works,
00:16so if you go into your Flash, actually into your File, Publish Settings,
00:21and you go into the Flash tab, click on the Settings, which is next to our ActionScript 3,
00:28so I'm going to click on the Settings, and in our Settings you're going to find
00:32all the way on the bottom here, a few different columns, but what we care about is the source path,
00:37and you're going to see in our source path that our source is dot,
00:40and it's kind of a Linux connotation that basically says dot is basically where I am,
00:45so my source path to my application is exactly where I am.
00:49Now if I wanted to, and a lot of developers prefer doing it this way,
00:53mainly if you're working with an SVN or something of that nature,
00:57a lot of people like separating between their FLAs and their deploys,
01:02so what a lot of times is common is you'll have your source, your deploy,
01:06and then you'll have your AS folder, for example.
01:09I personally don't really do that most of the time,
01:12but let's just for practice, if I just create a new folder, and I'm going to call it AS,
01:18and now I'm just going to grab our COM folder with all its content
01:21and just throw it into my AS folder.
01:25Now that it's inside of my AS folder,
01:27an AS is probably not a good name, let's just call it AS3,
01:31because AS is a reserved word, although it's not going to really bother us
01:34because we're not dealing with code, but it's better off not to confuse things,
01:39and we could always call our source, instead of source, we could call it FLA.
01:43So we have our FLA folder, we have our deploy,
01:45where our files that are going to go into production are going to be,
01:48and then we have our source files, which is the AS3 folder.
01:52Now if we try to run our application without, and you can see already
01:55we're getting here some sort of error telling us that it can't find our app anymore,
02:00and let's ignore that for now, and how could we fix that?
02:04So first of all, we could keep that dot, there's nothing wrong with that,
02:06we could add one more, and what we could say is basically go back,
02:10so it's two dots slash forward slash,
02:13and then we could say go into the folder AS3.
02:16Now the priorities are obviously, maybe not obviously,
02:20but the priorities are if there's a file that is called the exact same name,
02:24but it's located in this folder, it would take precedence.
02:28So if we wanted to, we could grab that one and push it up and say no,
02:31we want this to be on top, but in our case it doesn't really matter
02:34because we have nothing in here.
02:36The reason why I'm saying this is, for example,
02:38if you're working with open source files,
02:40if, for example, you start working with tweenmax,
02:43or one of those really fantastic open source options that a lot of,
02:46you know, the community is so rich with a lot of open source options,
02:49you might not want to put that in the same folder as your files,
02:53you might want to keep that in a central hub,
02:55and you might want to just put it, you know, in a place
02:57where you're sharing all those files throughout your application,
03:00or maybe in the near future after we practice a bit more building out classes,
03:05you might build out a class that you think that will be useful for other projects.
03:10And as soon as you get to that scenario,
03:12you might want to separate those files and basically create your own library,
03:16which is something that I like doing.
03:17I just create a folder called library,
03:19and in my library I just place items that I reuse or code
03:23that I think will be useful for me in the future.
03:25And obviously the packages make it much easier to organize,
03:29and with the beauty of the new CS5,
03:32and obviously if you're working in some sort of version of Eclipse Builder,
03:36then it makes it much easier also to then filter through.
03:40Everything got lost because we moved things around,
03:42and we changed the name of the folder of our FLA,
03:45so I'm just going to have to, you know, I'm just going to close it out, open.
03:50Well, the file that we already had because I renamed the folder name,
03:53so it kind of got lost.
03:55So I'm just going to go to publish settings one more time,
03:57flash settings, and create a new folder.
04:01And again, the AS3, I'm going to click OK, and OK one more time.
04:06And if I run my application one more time,
04:08we should be getting that star, and we are.
04:11And we're all set now and we're ready to roll.
04:14So if you download a file of someone else's,
04:17and you can't figure out where those files are,
04:20even if you see those file, the package paths,
04:23sometimes, like, there's some internal packages,
04:26such as the flash built-in one.
04:28So like, you might not be, it won't be easy for you to find the flash.display.movieclip folders.
04:34They're kind of, some of them really do exist,
04:36and some of them don't.
04:37There's kind of internal flash proprietary classes that they're not sharing.
04:42Some of them are shared.
04:44But as you're working with your application,
04:46the two places where you want to look and kind of make sure
04:48that you know where you are is one, what package are you in,
04:51and two, where is your source files.
04:54And to get to your source files, again, just to wrap this video,
04:57you'd go into your publish settings, and the settings,
04:59and you could see where your files are coming from.
05:02So for example, if you get someone's files,
05:04and you publish it, and it doesn't work,
05:06or you're getting a weird error telling you that you can't find those classes,
05:10first start by looking into these folders,
05:12because some developers won't put relative paths.
05:15Some developers will go and put a hard-type path.
05:18They might go to their desktop and decide that workspaces is their work path.
05:23And now they're locked into my Benfella folder,
05:25which if you take it and send it to somewhere else,
05:27or you try to run it on a different computer,
05:29they just wouldn't work, period.
05:31All right?
05:32So there's important things to know.
05:34And an easy way to say that, it makes it also easier for you to see,
05:37oh, OK, there's some external assets.
05:39Let me search on the web.
05:41Maybe I could get those files on the web,
05:44because sometimes they're going to be just one of those classic stuff
05:47that a lot of developers use, if it's with object,
05:50if it's between Macs and so on, that are very, very common.
05:55All right.
05:56So that is it.
05:58That cover is it.
06:00And I just clicked on OK one more time.
06:02Our display is just too big.
06:04And that covers really the basics of your file structure.
06:09Now, it's OK if you've got it, but you don't really remember it
06:12because we're going to do this over and over again
06:14as we're starting to build our classes.
06:17But it's a good place to start from to notice where these files
06:20and where their locations are.

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!