Not every project requires assets to be loaded at runtime, but the
ability to load files from external sources is extremely important and
cannot be overemphasized. Loading assets on the fly reduces initial file
size and, therefore, load times, and also increases the degree to which
a Flash experience can change. Such change includes not only the
all-important dynamic nature of updateable content, but also a
streamlined editing process that allows external assets to be altered
without having to republish the .fla file every time an update occurs.
The main purpose of this chapter is to cover loading external SWFs
and images, to augment prior discussions regarding sound, video, and
plain text. However, we also want to briefly address two issues very
closely related to loading from remote sources: communication among SWF
files of differing ActionScript versions, and security concerns. In this
chapter, well look at:
Loading Sound and Video.
Necessity required that we cover loading sound and video in Chapter11 and Chapter12, respectively,
including fairly robust, dedicated classes that separate the loading
of the assets from their use. However, well briefly cover the
basics here again to consolidate discussions of loading each major
asset type into one chapter.
filehandle is the name in a Perl program for an
connection between your Perl process and the outside world. That is,
it's the name of a connection, not
necessarily the name of a file.
Filehandles are named like other Perl identifiers (letters, digits,
and underscores, but they can't start with a digit), but since
they don't have any prefix character, they might be confused
with present or future reserved words, as we saw with labels. Once
again, as with labels, the recommendation from Larry is that you use
all uppercase letters in the name of your filehandlenot only
will it stand out better, but it will also guarantee that your
program won't fail when a future (lowercase) reserved word is
But there are also six special filehandle names that Perl already
uses for its own purposes: STDIN,
DATA, ARGV, and
ARGVOUT. Although you may choose any filehandle name you'd
like, you shouldn't choose one of those six unless you intend
to use that one's special properties.
A number that has only two factors, 1 and itself, is called a prime number. Numbers such as 2, 3, 7 and 11 are prime numbers. A number that has more than two factors is a composite number. Numbers such as 4, 8, 9, and 15 are composite numbers.
You can write any composite number as a product of prime numbers. For example, you can write 18 as the product of several prime numbers.
18 = 2 × 9 prime number
As you can see 9 is also a composite number. You can factor 9 to 3 × 3.