18.0. IntroductionWhen 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:
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:
This chapter focuses on inter-movie communication through the use of LocalConnection, allowing multiple movies on the same client computer to interact with each other. See AlsoChapter 24 has more information about communicating between clients on different computers through the use of socket connections. Chapter 19 has information about sending and receiving data, which may be useful in situations where real-time communication is not a requirement. |