Working with the Different Media Types

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.

Working with Graphics

Graphics are static images, either bitmap or vector, and are typically the most used media asset of all. You will use such assets to skin 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 or CSS. Graphics are an important part of Flex. You can’t completely maximize the strength of using such a rich UI framework as Flex without including custom user interfaces and engaging interaction.

Note

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.

Adding graphics

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. The Button component, for example, has an icon property. This property, like the ...

Get Programming Flex 3 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.