Accessibility
Peter Ent

Peter Ent

Adobe

Table of Contents

Created:
25 August 2008
User Level:
Intermediate
Products:
Flex

Understanding Flex itemRenderers — Part 2: External renderers

In Part 1 of this series I showed you how to make an inline itemRenderer—that is, an itemRenderer whose MXML tags and ActionScript code are in the same file as the list using the itemRenderer. The code is inline with the rest of the code in the file.

You'll also recall that I said you should think of inline itemRenderers are being separate classes. The Flex compiler in fact extracts that inline code and makes a class for you. The benefit of inline itemRenderers is that the code is in the same place as the list, but that's also a drawback when the itemRenderer becomes complex. What I'm going to show you in this article is how to make the class yourself.

Extracting the itemRenderer into an external file has several benefits:

  • The itemRenderer can easily be used in multiple lists
  • The code is easier to maintain
  • You can use Flex Builder's Design View to sketch out the initial itemRenderer

This series includes the following articles:

Requirements

In order to make the most of this article, you need the following software and files:

Flex Builder 3

Prerequisites:

To benefit most from this article, it is best if you are familiar with Flex Builder and ActionScript 3.0.

Creative Commons License
This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License

About the author

Peter Ent is a Computer Scientist at Adobe, working on the Genesis project. Prior to this, Peter worked for Adobe Customer Care as a Flex Support Engineer and then as a Technical Account Manager. Before joining Adobe, Peter worked in the financial services industry at State Street and Fidelity Investments. He also has experience at two start-ups building software applications doing imaging and molecular modeling. Peter holds a bachelor of science in Computer Science from Syracuse University. Visit Peter's blog.