Chapter 5. Using Bindings and Components


  • Using binding expressions

  • Creating MXML components

  • Instantiating MXML components

  • Creating component properties and methods

  • Creating and using component libraries

  • Creating Flash-based controls

In Chapter 1, I described the object-oriented concept of modularity and how dividing an application into small pieces can increase developer productivity and improve long-term maintenance of an application. I also described the concept of encapsulation that encourages developers to create application building blocks that hide the details of a feature's implementation from the rest of the application, and only expose tools in the module's public interface that are needed to set and get the module's information and execute its functions.

In this chapter, I describe some of the basic building blocks of a Flex application that can improve its modularity and make it easier to manage over time. I start with a look at binding expressions and describe how they help you easily move data around an application. A binding expression can move data from one object to another at runtime without explicit event handling or ActionScript statements. I describe a couple of binding syntax styles and show when to use each.

This chapter also includes a description of how to create and use custom MXML components in a Flex application. In the last section of this chapter, I describe how to package and manage multiple components and classes in a component library using ...

Get Flash® Builder™ 4 and Flex® 4 Bible 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.