Graphics Reference
In-Depth Information
Table 9.1 Naming Convention Examples
MovieClip containing a form
formMovieClip
TextInput for user's e-mail address
emailTextInput
Button to submit a form
submitButton
Sound object for background music
musicSound
makes everything that much easier to find and work with. Table 9.1
contains the same examples I used in the
Conventions and Best
Practices
d include it again for
people like myself who tend to flip around in topics.
Separating your site into different files is another good practice
to get into. You gain several benefits when you compartmentalize
your work in this way. One of those benefits is the option to easily
split the project among more than one developer where each per-
son works on a set number of sections in the site. You also gain
the benefit of quickly isolating and resolving issues and errors with
the site. For example, a bug might be reported to you that only
happens in the
section of Chapter 3, but I thought I
'
ve just passed on
to quality control. Because each section of your site is broken out
to its own file(s), you
About Us
section of a site you
'
re going to have a 99.9% chance that you
know exactly which file to open to fix the bug. Additionally, since
that file doesn
'
thavetodig
through any overly large libraries or classes to find the culprit of
your problem.
Because we
'
t contain the entire site itself, you won
'
'
re talking about compartmentalizing your work, let
'
s
talk a bit about classes. I
'
ll be completely honest here and admit
that I didn
t make any real use of classes until just before Action-
Script3cameout.DuringthedaysofActionScript2,Iwasbigon
putting the majority of my code on the timeline, and the most I
strived for was to get as much of it on the first frame of the main
timeline as I could. Now I find myself striving to have as little code
onthetimelineasIpossiblycanwhileremindingmyselfand
understanding that sometimes it
'
'
s necessary and it
'
s definitely not
any kind of a sin. Quickly for those who aren
t familiar with classes,
ActionScriptclassesarefileswiththe.asextensionandtheycan
contain the code to do anything from completing a simple task like
dispatching a custom event to building entire custom components.
Something else worth noting is that while writing classes with
ActionScript 2 was more forgiving in its rules, ActionScript 3 has
changed that leniency. In the years since ActionScript 3 was
released, there has been much debate in the development commu-
nity about whether or not that strictness is a good thing or not. As
a matter of fact, you can probably still find developers discussing if
'
Search WWH ::




Custom Search