Chapter 17. Custom components

 

This chapter covers

  • Making your own custom components
  • Using existing components as a base
  • Passing parameters to custom components
  • Retrieving values from custom components
  • Employing getter and setter functions
  • Broadcasting events from a custom component
  • Creating ActionScript components
  • Componentizing

You’ve come a long way in a short amount of time so far. You now know enough to create a standard Flex application!

You can capture and validate input from the user, interact with backend data services to get and transmit data, and format and display information. These are all great things to know, but unless you plan to have all your code in one huge file, you need to know how to break your application into smaller, reusable pieces.

This is where custom components come into play. Although this isn’t the only option for making code reusable, it’s one of the few de facto standards because of ease of implementation and the benefits that are gained from components. This chapter covers the basics of creating and utilizing custom components and tackles ways of getting your components to communicate with each other.

17.1. Understanding Flex 4 components

17.2. Creating simple custom components

17.3. Skinning with the Spark Skin object

17.4. Composite components

17.5. Creating advanced Flex 4 components

17.6. Get your components to communicate

17.7. Summary