Datasheet
8
Adobe Flex 2
e Flex class library contains Flex components, layout managers, behaviors, and service components.
With the Flex component-based development model, developers can create applications using
prebuilt components, combine prebuilt components into composite components, or create new
components by extending the prebuilt components or their base classes.
e ability to create custom components is one of the most powerful aspects of Flex development.
Like other enterprise runtime environments, Flash Player provides a rich set of services that
developers can use to construct components. ese include display APIs for drawing to the
screen, manipulating graphics, and controlling audio or video as well as APIs for accessing
network resources, parsing data, and performing calculations. Combined with the built-in
layout, data binding, and eects classes in the Flex component API, these provide a complete
environment for delivering a wide variety of custom applications.
MXML: The Flex markup language
Like HTML, MXML is a markup language that describes user interfaces that expose content and
functionality. Unlike HTML, MXML provides declarative abstractions for client-tier logic and
bindings between the user interface and application data. MXML helps maximize developer
productivity and application reusability by cleanly separating presentation and business logic.
e following code listing uses MXML to dene the user interface for a product catalog application. is
example uses the built-in Panel and DataGrid components as well as an instance of the WebService
class, which sets up a connection between the client application and the catalog web service.
<?xml version=”1.0” encoding=”utf-8”?>
<mx:Application xmlns:mx=”http://www.adobe.com/2006/mxml”
creationComplete=”ws.getList()”>
<mx:Style source=”main.css”/>
<mx:WebService id=”ws” wsdl=”http://mysite.com/services/CatalogWS?wsdl” >
<mx:operation name=”getList”/>
</mx:WebService>
<mx:Panel title=”Product Catalog”>
<mx:DataGrid width=”100%” height=”100%”
dataProvider=”{ws.getList.lastResult}”>
<mx:columns>
<mx:DataGridColumn dataField=”name” headerText=”Name”/>
<mx:DataGridColumn dataField=”price” headerText=”Price”/>
</mx:columns>
</mx:DataGrid>
</mx:Panel>
</mx:Application>
Figure 5 shows the resulting application, including the data retrieved from the web service.
Figure 5: A product catalog created with MXML and populated via a web service.










