Chapter 38. Browser Communication in Flex

In the vast majority of cases, Adobe Flex applications are presented to the user through a web browser. This chapter explores the methods that you can use to exchange data between your Flex application and the HTML page that contains your Flex application.

The following sections will walk you through scenarios that show you how to pass data into Flex applications using flashVars, how to exchange information back and forth from Flex to your containing HTML page using JavaScript, and seamless JavaScript/Flex integration using the Flex Ajax Bridge (FABridge).

Understanding the Web Context

Most commonly, Flex applications are presented to the user as compiled SWF files that are embedded within HTML content that is delivered over the Internet. The other option is that the Flex application is accessed directly as a SWF file. The end user does not necessarily need to know this, but from the developer's perspective, you must be aware of how the application is presented. The following sections will focus on the first scenario: interactions with Flex applications that are embedded within HTML content.

Flex applications are often delivered as full-page content within web pages. In this scenario, the Flex application takes up the entire available space within the web page. The application is designed to be a standalone application, with no user interface elements coming from outside of the Flex application itself.

Another common scenario is that Flex applications ...

Get Professional Adobe® Flex® 3 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.