Accessibility
iteration::two

Steven Webster

Alistair McLeod

iteration::two

Created:
7 March 2005
User Level:
Intermediate
Products:
Flex

Applying Behaviors and Effects in Flex Applications

Note: The book excerpt linked to below is from Chapter 13 of Developing Rich Clients with Macromedia Flex by Alistair McLeod and Steven Webster, published by Macromedia Press.

Developing
          Rich Clients with Macromedia Flex

In this chapter, you build an interactive shopping basket and product browser, achieving interactivity by using Macromedia Flex behaviors.

You'll learn that behaviors are a pairing of a trigger with an effect as you tour the built-in triggers and effects that Flex Presentation Server offers. You will customize these built-in effects using attributes. Finally, you will apply easing equations to provide interest to the types of movements and fades you can achieve.

Because you may wish to provide interactivity that Flex does not cater to out of the box, we will examine how to program effects using ActionScript 2.0 and define custom effects using ActionScript classes. Furthermore, you will learn how to trigger these effects using custom event handlers rather than the predefined triggers that Flex attaches to components.

Errata

Below are important errata that the authors have provided for Chapter 13 of the published book.

The authors would like to acknowledge Dan Harfleet for compiling the errata for this chapter. For further information on migration issues between Flex 1.0 and Flex 1.5, the authors suggest reading Migrating Flex Applications in the Flex documentation.

  • widthFlex and heightFlex attributes (p. 307) – Setting percentage width and height values. Width and height values can now be set as a percentage, the value being the percentage of the parent container that the component should span. (See "Migrating Flex Applications.")
  • width and height should be explicit on TextArea (p. 310) – Parent container sizing rules have changed. Parent containers do not expand to fill their parent automatically; they expand enough only to take up the space needed by its child. Therefore you must explicitly set width and height percentages.

Requirements

To complete this tutorial you will need to install the following software:

Flex 1.5

Download the complete chapter:

Buy the book:

Steven Webster and Alistair McLeod, Developing Rich Clients with Macromedia Flex, © 2005 iteration::two. Reproduced by permission of Pearson Education, Inc. publishing as Peachpit Press. All Rights Reserved.

About the author

Steven Webster is a technical director at iteration::two, a world-leading Rich Internet Application consultancy based in Edinburgh, Scotland. Steven is the author of Reality J2EE: Architecting for Flash MX and coauthored ActionScript 2.0 Design Patterns for Rich Internet Applications (ActionScript 2.0 Dictionary) and Developing Rich Clients with Macromedia Flex with Alistair McLeod. Steven speaks regularly at conferences and user group meetings on technical and business aspects of RIAs. Steven is the core contributor to the open-source Cairngorm project, a micro-architecture for RIAs based on J2EE patterns which was innovated by iteration::two over a number of Flash and Flex RIA developments.

Alistair McLeod is a development director at iteration::two, a world-leading Rich Internet Application consultancy based in Edinburgh, Scotland. Alistair coauthored ActionScript 2.0 Design Patterns for Rich Internet Applications (ActionScript 2.0 Dictionary) and Developing Rich Clients with Macromedia Flex with Steven Webster, and has spoken at industry conferences, including Macromedia MAX. A strong advocate of agile software development, Alistair is the core contributor to both the AS2Unit and FlexUnit unit-testing frameworks for the test-driven development of Rich Internet Applications. Alistair has led the development of several RIA projects into production, including the first European deployment of a Macromedia Flex project.