Chapter 21. Development Strategies

As any developer who dives into a project quickly realizes, there is a difference between understanding a framework or a library or even a programming language and knowing the best way to put those tools to work to create an application. This chapter provides some common tips for creating components and structuring an application with Flex 3, the Flex Builder IDE, and the Flash CS3 IDE. These recipes run the gamut—from tips to help you develop a component to structure an application, to using the Cairngorm framework. Although some recipes cover items within the Flex SDK (such as the Flex Component Kit), most focus on how to integrate the Flash IDE and other tools to help you develop components, or how to use other frameworks (such as PureMVC and the Cairngorm framework) to help you develop applications.

21.1. Use the Flex Component Kit to Create Components

Problem

You want to integrate content from the Flash IDE into your Flex application

Solution

Install the Flex Component Kit into the Flash CS3 IDE. Then create a symbol and convert it into a component by using the Convert to Flex Component command. Publish the movie as a SWC file and add it to a Flex project.

Discussion

You can load Flash content into a Flex application by using the SWFLoader class or the flash.loader class. After these objects are loaded into the application, however, you can far more easily control them by using the Flex Component Kit. The Flex Component Kit extension simplifies the ...

Get Flex 3 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.