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 ...

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.