Section .6. Troubleshooting


.6. Troubleshooting

You may glide through this entire text with nary a problem. However, don't feel bad if you have your fair share of glitches. Here are some of the common issues you may run into, and how you might address them:


Missing source files

Early in this book, it was recommended that you copy the source directory from the CD-ROM to a designated directory on your hard drive. If your hard drive space is limited, you may also consider copying files one chapter at a time. If you need to delete provided files from your drive to make room for new files, they will always be there on the CD. Finally, if you're really in a pinch for space, you can open files from the CD and save them locally only when needed. In any case, try to designate one directory as your source directory, whether it remains on the CD-ROM or exists on your hard drive. To simplify references to the parent source directory, it has been called your working directory throughout this book. Usually, files have been provided in many stages of development to guide you through each project. They have been named sequentially with numeric suffixes to make it a little harder for you to overwrite them with your own files. However, if you do, don't worry. Simply copy them over again from the CD-ROM.


Missing or differing menu commands or keyboard shortcuts

Flash development is largely identical on both Windows and Macintosh platforms, although some of the keyboard shortcuts and locations of menu commands vary slightly. If you're having trouble with a particular step, check to see if any platform-specific information has been included, and that you're using the right keyboard shortcut. Typically, keyboard shortcuts are identified by platform, or the Windows command is listed first, followed by the Macintosh equivalent (e.g., Ctrl/Cmd-V).


Missing features

This book assumes that you are using, or evaluating, Flash 8 Professional. If you are using the Basic version, some features may be missing. (See "Flash 8 Basic Versus Professional" for details.)


Components animate through many visible states
Static typing does not generate expected warnings

These problems may occur if your file is not configured to use ActionScript 2.0. Open the File Publishing Settings dialog and, under Flash, make sure ActionScript 2.0 is selected.


Seemingly correct scripts generate unexpected errors, including "Statement must appear within on/onClipEvent handler"

Check to make sure you are placing the code in the appropriate place. The context sensitivity of the Actions panel makes it easy to add a script to the wrong location. Click in a frame to add a frame script. To add a script to a movie clip or button, be sure it's the only item selected. An easy way to check that you're adding your script to a logical location is to check the string that follows "Actions" in the title bar of the Actions panel. It will say Frame Script, Movie Clip, Button, or something similar, depending on your selection.


Seemingly correct scripts don't work, but don't generate errors

This can occur for many reasons, but one likely reason is that the script calls for an instance name, and you have not named the movie clip or button. Add instance names to symbols in the Properties panel. See the "For Instance" sidebar in Chapter 6 for more information.

Other possible causes for this problem may be that the item you wish to control has not yet loaded or is not in the frame where you wish to manipulate it. Scripts always load from the top layer to the bottom, but you can change the order in which assets are loaded in the Publish Settings dialog. Try switching the load order from Bottom Up to Top Down. If the script starts to work, you may not be giving the assets enough time to load before referencing instances in your scripts. Similarly, make sure an instance is in the frame where you first define its event handlers and properties.


Some components work and others don't

This may be because you are using a mixture of old and new components. As of Flash MX 2004, Macromedia switched to the v2 component architecture to take full advantage of ActionScript 2.0. Older components may not be compatible with this architecture. Similarly, v2 components require ActionScript 2.0 and will not work in files set to compile with ActionScript 1.0. See "Components animate through many visible states," earlier in this list.


X- and y-coordinates in the project instructions don't yield intended results
X- and y-coordinates in the source files match the project instructions

Flash features two ways to reference x- and y-coordinates of a Stage-bound asset: by the asset's registration point and by its upper-left corner. If your x- and y-coordinates are not what they you expect them to be, open the Info panel. The tiny nine-dot grid near the center of the panel has two active dots. The upper-left dot will set the coordinate system to use the upper-left corner of a symbol when citing positions. The center dot will use the asset's actual registration point (even if it's no longer at the center of the asset after an edit). Try switching this selection to see if your numbers match the project and/or source files.


A missing font warning appears

This simply means that you don't have the fonts necessary to edit the relevant text fields without changing the font used. If you make no edits to affected text files, you can still edit other portions of the file, and the fonts will be unchanged. You can then acquire the correct font and publish your file without incident. If you don't expect to be able to acquire the font, you can use the Missing Fonts alert dialog to substitute another font for publishing only. (The alert will appear automatically when you display on the Stage a scene containing a missing font. Clicking Select Substitute Fonts will open the Font Mapping dialog, which you can also access via the Edit Font Mapping/Flash Professional Font Mapping menu command.) This will not edit your file, so it will allow you to adjust the font later, if desired. As a result, however, the warning will show every time the font is missing.


A warning asks if you want to abort a script because it is running slowly

You should always say yes to this warning. Usually it means you've made an error when creating a loop or referring to a variable, and you're stuck in a very large or infinite loop structure. It's best to heed the advice of the alert and try to find the problem. If you don't abort the script, Flash will continue to try to execute the script and may freeze. If this happens, you may need to force quit the application.

If this list doesn't address the problem you're having, first consult the companion web site for this book, http://www.flash8projects.com. If you don't find an answer to your question there, contact the publisher at bookquestions@oreilly.com.



Flash 8(c) Projects for Learning Animation and Interactivity
Flash 8: Projects for Learning Animation and Interactivity (OReilly Digital Studio)
ISBN: 0596102232
EAN: 2147483647
Year: 2006
Pages: 117

Similar book on Amazon

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net