Chapter 17. Communicating with Other Movies
Introduction
When we speak of Flash movies interacting with one another, there are two types of interactions. First, there are interactions between movies that are running on the same computer. And second, there are interactions between movies on different computers.
Prior to Flash MX, the only way to communicate between movies on the
same computer (without using server-side functionality)
was to use the fscommand(
) global function, which executes JavaScript methods.
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 MX 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.
Additionally, prior
to Flash MX, the only way to communicate
between movies on different clients was to use a socket connection
via the XMLSocket class. While the
XMLSocket class is still a valuable and powerful
technology, it has its disadvantages:
Using sockets requires a server-side socket server. Although creating your own socket server requires proficiency in a server-side ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access