18.0.
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:
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 Communication Server) to
allow separate movies to send and receive data between
themselves.
-
A socket connection can be made to a server that
can handle a message passing between all connected clients.
-
For communication that is not considered
real-time, it is possible to use a polling methodology coupled with
a server-side technology to send and receive new information from
the server at certain intervals.
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 Also
Chapter 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.
|