Including SWC’s via Relative Path Instead of Full Path

MarkBlog

I recently sent the current code and project files for a simple application to a fellow developer, so they could get to grips with some key points… I forget the specifics, but it doesn’t matter for the purposes of setting the scene :-)
They received the ZIP file.
Extracted it.
Fired up the FLA.
And everything seemed great until they hit the ole’ Ctrl+Enter and received errors.  I know this code and project work.
So what’s the problem?

It’s a simple one: the library files, or SWC’s to you and I.

You see, I store my library files in one place.  It makes it convenient for me so that if there are any updates, I just make a backup of the old one, put the new one in place (making sure the filename matches) et voila.  No changes to the multiple projects.
But what if you’re sharing a project?

Well, I figured you can use relative paths when including a folder for Classes, so why not for library files.  Turns out, you can!
What I mean by relative and full path is this:
A full path (on Windows) typically looks like C:\some\directory\where\my\SWC\lives\importMe.swc
Whereas a relative path could look like this ..\SWC\lives\importMe.swc

In a simple project like this one, I created a folder called “Includes” and put my SWC library files in there.  Next, in Flash, I hit the ActionScript Settings ->  Library Path tab.
In here, I removed all references to the individual SWC’s.  Then hit the “+” and put “./Includes ” (minus the quotes) instead and tentatively hit Ctrl+Enter.
Whatta you know… it works!

[My path is ./Includes, as that means “the current folder where the FLA is, then look for a folder called “Includes” and use the stuff in there.”  If you need to go “up” a folder, you want “../ ” and if you need to go several folders deep, then you simply ./type/multiple/folders]

If, like me, you have several projects sharing the same libraries, and having those (albeit 1MB in size) libraries copied a plethora of times can be an issue – then the updating that I mentioned before etc.
But, if you’re sharing a project or code, then this relative path method might just help!

___________________________________