In previous versions of Flash, the only visuals that could be loaded in at runtime were nonprogressive JPEGs and SWF files. Now you can import GIFs, PNGs, and progressive JPEGs in the same manner as in previous versions of Flash. When you import any of these image types with transparency, the transparency will be maintained.
Following is an example of loading a progressive JPEG as a background image and then loading a PNG image over top of it.
You can use any images you like, or grab the ones from the website.
The preceding code first creates two empty movie clips to house the images you are loading. Then you load the background image into the first movie clip. After that, you create an event so that when a user clicks the mouse on the stage, the second image will load.
Test this movie, and you should see something like Figure 1.13. Notice that the transparency of the second image is maintained.
Figure 1.13. Flash can load in transparent PNGs at runtime.