As a developer, you may have a lots of custom ActionScript classes organized within packages to make your work easier and faster for creating flash apps. For this reason, you need to make all of these classes available for use in your projects without having to copy your ActionScript files to the directory where your FLA files reside.
When you set a source path, your packages and custom classes will be available for all your flash projects automatically, and all you have to do is type your code, importing only custom classes that you need for that specific app.
This tutorial is short but it's very useful for flash developers.
Let's think you have a folder named "My ActionScript Classes" located in C: drive where you store all your custom classes arranged into packages.
Following this, let's consider you have the structure of packages below, within the folder "My ActionScript Classes":
demo > messages > DefaultMessage.as / CustomMessage.as
demo > system > CustomUser.as / CustomUserAdmin.as
Now, we can go to Adobe Flash CS4 Professional and make all changes we must do.
Right! Adobe Flash CS4 now knows where to look for our classes, if needed. To test it, create a new Flash File (ActionScript 3.0), open the Action panel and type...
import demo.messages.*; import demo.system.*;
When you run the application, no errors are displayed for us. Because these packages really exist, and they are being referenced by Flash, so any flash file can use our classes, no matter where your FLA files reside.
You can also reference SWC files using Library Path or External Library fields, in that same window.
Once again, I hope this article was useful for everyone who uses Flash CS4.
Thanks for reading!!!