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.
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!
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!