Flash AS3 Tutorials Center | Interesting Flash Animation Tutorials | Valuing Flash Animation Tutorials | Flash ActionScript and Animation Home

AS3 Beginner Tutorials | AS3 Basic Lessons | AS3 Valuing Courses | AS3 Components Tutorials | AS3 and PHP Interaction Tutorials
AS3 Practical Tutorials | AS3 Animation Techniques | AS3 Transition Effects Tutorials | AS3 Download Upload Files | AS3 Particle Systems
Communication Between Flash Movies with AS3 | AS3 and JavaScript interaction | AS3 Matrix Transformation | AS3 Physics Simulation Tutorials

Communication Between Flash Movies with ActionScript

From Flash Player 6, Flash developers can use Local Connections to communicating between Flash Movie. Local Connection provide a much easier means that Flash movies can broadcast to and listen for broadcasts from any other movie on the same computer.

Basic Concept of Flash Movies Communication:

Communication between Flash Movies can easily be achieved by using Local Connection. The basic concepts is that:

- the sender Flash Movie sending broadcasts to other receiver Flash Movie,

- the receiver Flash Movie is listening to broadcasts sending from the sender Flash Movie.

Of course you have to set up connection between the sender Flash Movie and the receiver Flash Movie.

Basic steps setting up communication between flash movies.

Sender Flash Movie:
//The first step is to create a LocalConnection object.
var receiverLC:LocalConnection = new LocalConnection();

// Use LocalConnection.send( ) to call a function in the receiver movie.
receiverLC.send("_myConnection", "functionInReceiver");

Receiver Flash Movie:
//Create a LocalConnection object.
var receiverLC:LocalConnection = new LocalConnection();

// Use LocalConnection.connect( ) to listen for any messages
receiverLC.connect("_myConnection");

//Define the function that will be called upon from the sender.
function functionInReceiver ():void {
    doAnyThing.......;
}

The whole stroy of how Flash Movies communicate with each others is explained in the following diagram:

local connection sender and receiver flash movies

 

Remarks:

This Flash ActionScript tutorial shows how Flash Movies communicate with each others.