O'Reilly logo

Programming Flex 2 by Joey Lott, Chafic Kazoun

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

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 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.

Tip

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

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