Chapter 13. LOADING ASSETS

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, we’ll look at:

  • Loading Sound and Video. Necessity required that we cover loading sound and video in Chapter 11 and Chapter 12, respectively, including fairly robust, dedicated classes that separate the loading of the assets from their use. However, we’ll briefly cover the basics here again to consolidate discussions of loading each major asset type into one chapter.

  • Loading Text. We also discussed loading text in Chapter 10 but limited our coverage to loading of plain text to support HTML and CSS exercises. In this chapter, we’ll also look at loading URL-encoded ...

Get Learning ActionScript 3.0 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.