O'Reilly logo

The ActionScript 3.0 Quick Reference Guide by Rich Shupe, Darren Richardson, David Stiller, Jen deHaan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 17. How Do I Work with External Assets?

17.0 Introduction

Flash is capable of many tasks by only using assets that have been created or imported into the authoring environment. However, one of its greatest strengths is its ability to work with external assets at runtime. Flash Player can load several kinds of assets including plain text, XML, HTML, CSS, URL-encoded variables, images, sound, video, and other SWF files, to name some examples. It can even load raw binary data.

This chapter provides a brief overview of loading and unloading a few of these external asset types. You can do very different things with each asset type, depending on the asset, security restrictions, and the version of Flash Player you’re targeting. However, the recipes here should give you some idea of what’s possible, as well as warn you about some possible pitfalls, to help you along the way.

To improve your memory management efforts, and to save some possible debugging time, you should know a little about how Flash Player 9 and later flushes objects from RAM. In short, you can’t immediately remove something from memory. Instead, Flash Player uses a process called garbage collection. When an object is no longer in use, Flash Player marks it for collection. Subsequently, during an optimal low in processor demand, the garbage collector sweeps through and collects all objects previously marked for removal.

Unlike your neighborhood trash removal service, however, you can’t predict when garbage collection ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required