Lesson 10. Creating Custom Components with ActionScript 3.0


What You Will Learn

In this lesson, you will:

  • Create a class for your component

  • Embed images in ActionScript

  • Instantiate Flex components in ActionScript

  • Programmatically add components to a Container

  • Override the createChildren() and updateDisplayList() methods

  • Understand the rawChildrenList property of Containers

Approximate Time

This lesson takes approximately 1 hour and 30 minutes to complete.

Lesson Files

Media Files:

None

Starting Files:

Lesson10/start/Dashboard.mxml

Lesson10/start/views/dashboard/ChartPod.mxml

Completed Files:

Lesson10/complete/Dashboard.mxml

Lesson10/complete/views/Dashboard/ChartPod.mxml

Lesson10/complete/views/MaxRestorePanel.as

In Lesson 7, "Creating Components with MXML," you learned how to build custom components using MXML. There are times when you will need even more flexibility than MXML can offer you. For these occasions, you can create components in ActionScript 3.0.

In this lesson, you will create a new component called MaxRestorePanel, which extends the Panel component and adds icons to the title bar to enable users to choose to maximize or restore the panel.

The Dashboard will use your new component instead of the Panel.

Here you see the MaxRestorePanel in its maximized state.instead of the Panel.




Adobe Flex 2.Training from the Source
Adobe Flex 2: Training from the Source
ISBN: 032142316X
EAN: 2147483647
Year: 2006
Pages: 225

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net