Organizing files and storing code

Consider the following guidelines before you start organizing files and storing code:

  • Do you divide the SWF file into multiple SWF files, and, if so, how should they interact?

  • What assets can you share across SWF files?

  • What files do you dynamically load?

  • How and where do you store ActionScript?

    When you develop an application, store your server-side code and files in a logical directory structure, similar to those in an ActionScript package. Arrange your code this way to keep it well organized and reduce the risk of the code being overwritten.

    For larger applications, encapsulate client-server communication and services in classes. When you use classes, you benefit in the following ways:

  • You can reuse the code in more than one SWF file.

  • You can edit code in a central place, and update all SWF files by republishing them.

  • You can create a single API that can manipulate different UI elements or other assets that perform similar functions.

  This page on the Web