ABSTRACT

While code is certainly a huge part of most games, the assets the code manipulates (art, sounds, text) are usually equally important. Unlike most programming languages where such resources reside as individual fi les separate from the code, every Flash fi le has an associated library that contains all the assets that will get bundled into the SWF at compile time. Once you have imported an asset into your library, you no longer need the external fi le unless you make updates to it. This allows for easier access by multiple developers, since someone who needs to work on a Flash fi le only needs the FLA in most cases. While you could arguably create a SWF that was all code and loaded in all of its resources at runtime, that is working against Flash’s nature and creates a lot of extra work for very little return in almost every situation. Flash can also add extra layers of compression to assets that cannot be achieved by accessing them externally, meaning a single SWF containing all of its resources will be smaller than all of those individual fi les put together. Throughout the rest of this chapter, I will discuss the different types of assets you will need to know how to work with when creating games in Flash.