Oct
19
2009

TIP: Setting the class path permanently for all Flash projects

When working with classes, you need to show Flash where to look for them. In order to do that you need to define a class path – which points to the root of the whole organized structure of directories and subdirectories containing your different classes (packages). I used to define a document-level class path – separate for every new Flash project. But there is a way of creating a global class path for all the projects you will work on.

Defining a document-level class path

The way I was doing this was to go to File -> Publish Settings or clicked on Edit button for Profile on Properties panel):

properties panel

then select Flash tab and click on Settings button next to the Script settings.

publish settings

settings

This way we actually define a document – level class path, what basically means that every time when you work on a new project, you have to repeat this task.

Defining a global class path

To set a global class path for all projects, go to Edit -> Preferences...:

Properties...

choose ActionScript category, and select “ActionScript 3.0 Settings...” button in Language section and select the Source path.

global path

This will save you these few clicks and few seconds every time when creating new project :)

BTW, one thing to remember... When you are working with one class and you want to use another class which is in the same package, then you don't need to import it - Flash will import it automatically.

 

AS3 Tips

I'm with Adobe - Facebook group