• Selecting months is a very common task.
  • Rather than re-creating a months menu everytime you need one, create a re-useable component.
  • The new custom MXML component inherits the properties, methods and events of the original Flex component
  • MXML components do not have the Application component tags
  • Custom MXML components can reference other Flex components
  • Custom MXML components can not be named the same as existing Flex components
  • The component file name becomes the name of the custom component that is used in your application
  • Create a namespace to have access to your components directory or to a specific component in the directory. (xmlns:custom="components.*")
  • Call your component with the namespace you created ( <custom:ComboBoxMonths id="month" />)

previous page next page

Your Rating:
5 rates



  • Download aZIP filethat contains the applications in this module. To import the project into Flex Builder, select File > Import Flex Project.

Rendered Example

previous page next page

  1. Jul 30, 2008

    Note: I believe the canvas width in the rendered example above was set too small.

    If you downloaded the zip file that contains the applications in this module, MainForm.mxml above refers to CustomComponent1.mxml in the zip file.  You'll need to change the following line to match the tutorial above:

    <custom:ComboBoxMonths0 id="month" />

    (note the zero after ComboBoxMonths)