O'Reilly logo

Professional Adobe® Flex® 3 by Joe Berkovitz, David Hassoun, Andrew Trice, Tom Sugden, Todd Prekaski, Jun Heider, Peter Ent, Joseph Balderson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 43. LocalConnection and Shared Objects

This chapter will cover features in the Flash Player that enable you to implement local inter-SWF communication and persist local data. The following concepts are covered in this chapter:

  • The LocalConnection class

  • Local shared objects (LSOs)

Overview

There are times when you would need to allow your Flex and AIR applications to communicate with other applications that are running on the local system. For example, you might want to use an AIR debug tool that receives debug messages from Flex applications that you are debugging. Or you might need to communicate from an ActionScript 3-based application running in the AVM2 to an ActionScript 2-based application running in the AVM1.

It would also be nice if you could persist data locally. In one application, you might want to automatically log a user into your Flex application. In another, you might want to save user preferences such as background colors, layout style, or default search orders. The following sections take a look at two technologies built into the Flash Player to enable you to handle these scenarios.

The LocalConnection Class

Chapters 38 and 39 discussed features such as ExternalInterface and the Flex-AJAX bridge. Although you can use those features to allow inter-SWF communication, you can communicate without having to rely on cross-scripting. The flash.net.LocalConnection class is used to leverage the built-in capabilities of Flash Player and the AIR runtime for local inter-SWF ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required