So far, we have explored how to load media and the different syntax used for embedding media. Although the general approach is very similar across the different media types, there are some subtle differences that you need to be aware of to best use media in your Flex applications.
Graphics are static images, either bitmap or vector, and are typically the most used media asset of all. You will use such assets to reskin a UI control, to load pictures, and pretty much whenever you want to display a graphic that you do not want to reproduce using ActionScript. Graphics are an important part of Flex. The strength of using such a rich UI framework as Flex can't be completely maximized without including custom user interfaces and engaging interaction.
Vector graphics differ from bitmap graphics in that they are represented through polygon shape definition rather than pixels. Because they're represented via polygon data rather than pixels, vector graphics have higher resolutions and smaller file sizes than bitmap graphics do. Flash Player also exposes vector drawing capability through the ActionScript drawing API.
The Flex framework simplifies working with graphics. One way to work with graphics in Flex is via the
Image component. All Flex components that use graphics work in a similar manner, but each serves its own purpose. For example, the
Button component has an
icon property. This property, like the