Chapter 18. Communicating with Other Movies

Introduction

When discussing Flash movies interacting with one another, there are two possible scenarios to consider. First, two movies running on the same client computer may have the ability to communicate with each other. Second, there is communication between movies running on different computers.

Prior to Version 6 of the Flash Player, the only way to communicate between movies on the same computer (without using server-side functionality) was to use the fscommand() function to execute JavaScript methods and use that JavaScript to bridge the communication gap between the movies. Unfortunately, these methods were both cumbersome to use and not always reliable (due to lack of support in various browsers). Also, these methods worked only with Flash movies running in web browsers in which the browser windows had references to one another. However, Flash Player 6 introduced local connections, a means by which any Flash movie can broadcast to and listen for broadcasts from any other movie on the same computer. The advantages of local connections are:

  • They are relatively simple to use.

  • They are implemented entirely in ActionScript and they work for movies running in Flash Player 6 or later.

To communicate between movies on separate client computers, the use of a server-side technology is required. There are three possible approaches to use in this scenario:

  • Remote shared objects can be used in conjunction with Flash Media Server (formerly Flash ...

Get ActionScript 3.0 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.