Versions, Directories, and Workflow
As you begin to do more ambitious things with Flash and ActionScript, you'll probably want to create multiple versions of your projects. For instance, you may find yourself with a working solution, which you'd like to use as the basis for something more sophisticated. Tinkering with the first version could prove disastrous, if you lose your way. The original, working code will be lost, remaining only in your carbon-based memory.
Here's a much better idea, illustrated by the screenshot below: whenever you start a new version of a project, create a new folder, or directory, for the fresh code.

The screenshot above shows a Windows Explorer view of the directory structure on one of my computers, where I've been working on multiple versions of the second Lab, or "Invaders" project. As you can see in the righthand window, the subfolder MULTISHOT contains four .as files, the .fla file for the main movie, and the .swf that is generated when the main movie is tested.
If I wanted to start a fresh version based on this file set, I would first create a new folder, then copy into it everything except the .swf. (Though nothing too terrible will happen if I bring the .swf along as well.)
My next move would be to rename the .fla file something appropriate, say, lab02_Multishot_X2. I would leave the names of the other files untouched -- and this is crucial.
Remember, each MovieClip (or similar Flash object) defined in the main movie has dependencies on a particular .as file. If the names of these files change, the code won't work unless we also change those dependencies -- and the various key points in the ActionScript files -- way too much typing.
THIS IS WHY WE CREATE A NEW DIRECTORY -- because doing so lets us keep the names of the .as files unchanged, yet maintain the files as distinct bodies of code.
Be very careful, however. If you drag a .as file from one subfolder to another, it will overwrite the corresponding file. There are times when you will want to do this, but never do it inadvertently.
Like most things about Flash scripting, this suggested treatment of versions and workflow demands attention to detail, and a consistent awareness of process. Welcome to the coding life.
|
|