Game Development Reference
In-Depth Information
You can change many parameters that determine exactly how the SWF file is
published from the Flash SWF publish settings. To access the publish settings, select
File ° Publish Settings and then select Flash . You won't be looking at any of these cus-
tom settings in this topic, but you should know that they exist because you might find
yourself working on a project when you'll need to make some changes to them.
It didn't work?
There might be an unlucky few of you who did not see the output shown in Figure 1-9. Instead, you
saw a Compiler Errors window, showing you an error message you probably don't understand, such as
the example shown in Figure 1-10.
Figure 1-10. If you made a small mistake in your code, such as forgetting to close one of the curly braces as in
this example, you will receive an error message in the Compiler Errors window.
This error message means that somehow, somewhere, there is a mistake in your code.
When Flash creates the SWF file, it compiles your AS3.0 code. Compiling the code is the job of a soft-
ware component that's part of Flash called the compiler . It checks to make sure that your code is
okay; if it is, it creates the SWF file. If it finds a problem, it gives you an error message.
Unfortunately, Flash's compiler doesn't know what you intend your code to do; it can only tell you
what it expects and what it doesn't understand. If you're lucky, it precisely pinpoints the problem. But
more often than not, it will just be able to give you a general idea of where to look and what to look
for. It's a bit like a two-year-old yelping with pain and pointing to his big toe. You know where the
problem is, but whether it's a thumbtack, a bee sting, or just another way of saying, “The last time I did
this you gave me some chocolate,” the remedy will depend on experience, skeptical investigation, and
a thoughtful diagnosis.
The Compiler Error window tells you on which line of your program it thinks your problem lies. If you
click the error message with the mouse to select it and then click the Go to Source button, it will actu-
ally highlight the spot in your code for you. For the rest, it's up to you to intelligently analyze what
you think Flash is looking for and what you might have to fix or change to get your program running
properly.
 
Search Nedrilad ::




Custom Search