- Home
- Tutorials
- Flash
- Intermediate
- Communication between two movies
Communication between two movies

page1
Marghoob Suleman
This user is yet to take control of their account and provide a biography. If you are the author of this article, please contact us via support AT actionscript DOT org.
View all articles by Marghoob SulemanYou will learn the following things in attached movie:
1. Communication between two movies.
2. Dragging
3. Moving element onMouse movement.
I am going to show you only communication chapter . I know you can learn moving, dragging etc things by yourself. :-)
Now Ready! First create two movie (movie A) and (movie B). Here 'movie A' is used for sending data and 'movie B' is used for receiving data from 'movie A'.
Things to remember in sending movie (movie A).
First create a local connection // my_lc = new LocalConnection()
Then send data using 'send' function // my_lc.send(connectionName, method, argument(s))
Example: (movie A) :
Write the following code on buttons and send the value.
on(rollOver)
{
my_lc= new LocalConnection();
my_lc.send("_myLocalConnection","recievedValue","Home")
// sendingData("Home")
// you can also create a function for this. So you don't have to write these code every time for every button.
}
Now have a look below for receiving value from movie B.
Things to remember in receiving movie (movie B).
Create a local connection // myReceiving_lc = new LocalConnection()
Then connect the local connection // myReceiving_lc.connect(connectionName)
and create a method whatever called in movie A.(We've called "recievedValue") // myReceiving_lc.recievedValue = function()
Example: (movie B):
Write the following code in frame 1.
myReceiving_lc = new LocalConnection() // creating local connection
myReceiving_lc.connect("_myLocalConnection") // this " _myLocalConnection" local connection is created in movie A.
myReceiving_lc.recievedValue = function(menuName) // this method is called by movie A.
{
myText=menuName // you should create a textbox.
trace(menuName)
}
Spread The Word
Related Articles
5 Responses to "Communication between two movies" 
|
said this on 23 Apr 2008 9:18:21 AM CDT
Hi Marghoob,
I just ca Does Thanks Jon |
|
said this on 23 Apr 2008 9:25:35 AM CDT
Ah!
It wasn't workin Cheers J |
|
said this on 17 Apr 2009 12:26:41 AM CDT
Mmm. Doesn't work in IE7,
Any idea? |
|
said this on 31 Dec 2010 3:57:47 AM CDT
Great! I really like it,
|
|
said this on 12 Mar 2012 4:10:21 PM CDT
Thanks Brian for your won
|



Author/Admin)