When using Flash regularly, as with any other software, there are tasks repeating in many projects over and over again. To speed up this process, it just makes sense creating your own classes and functions and having them available for all projects to use.
So how do we do this?
In order to have a class accessible to all flash projects, we need to add a location (a folder on your computer where you’ll store your classes) to the Source Path.
Go to Flash > Preferences, (this is based on Mac OS X & Flash CS4) and you will get a Preferences window. In the left column select Actionscript.
At the bottom of the window you will see 2 buttons Actionscript 2.0 Settings and Actionscript 3.0 Settings.
Click on Actionscript 3.0 Settings if you’re using AS3 for your projects.
In the Source Path area click on the “folder” icon (Browse to Path) and locate a folder on your computer where you’ll be storing your classes available to all projects.
And that’s it, now you can use these classes within your projects by importing them like so:
Which would import all classes within “net” folder which is within “moonpixel” folder which is within your folder you specified in the Source Path.