# FMX: controling another movie

**URL:** https://forum.kirupa.com/t/fmx-controling-another-movie/14068
**Category:** flash
**Created:** [February 21, 2003, 4:16pm UTC](https://forum.kirupa.com/t/fmx-controling-another-movie/14068 "2003-02-21T16:16:00Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![Uli](https://avatars.discourse-cdn.com/v4/letter/u/ccd318/32.png) [@Uli](https://forum.kirupa.com/u/Uli)
#### Post date: [February 21, 2003, 4:16pm UTC](https://forum.kirupa.com/t/fmx-controling-another-movie/14068/1 "2003-02-21T16:16:00Z")

</div>

Hello All,  
Could someone point to me some tutorial on how to control another swf in a html page?

I’m having a 2 flash movies in my web page (let’s say index.html , movie01.swf and movie02.swf). Is there a way, when something happens on movie01 (like a click) that movie02 does something as well like plays a MC? My HTML page has 3 frames, 1 top, 1 left, 1 main. Movie01 on top and Movie02 just a small area in left frame.

TiA 🙂

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 21, 2003, 5:18pm UTC](https://forum.kirupa.com/t/fmx-controling-another-movie/14068/2 "2003-02-21T17:18:20Z")

</div>

Yeah that’s pretty easy using LocalConnection.

on The first frame of Movieone.swf (The sender movie in this case), insert this action:

myButton.onRelease = function() {  
myLocalConnection = new LocalConnection();  
myLocalConnection.send(“IncomingMessage”, “onRecieve”, myTextBox.text);  
myLocalConnection.close();  
};

Ok, here goes, when myButton is pressed, a local connection object will be created, then it will send an incoming message to the function onRecieve with the parameter myTextBox.text (The text you will be inputing in that field) to the reciever movie.

on The first frame of Movietwo.swf (The reciever movie in this case), insert this action:

myLocalConnection = new LocalConnection();  
myLocalConnection.onRecieve = function(parameter){  
myTextField.text = parameter  
//Anything else, mc.play() etc  
}  
myLocalConnection.connect(“IncomingMessage”);

When the incomingMessage is recieved, the parameter will be assigned to myTextField…Looks confusing, check the attached example then. open both movies together, submit a message, and you’ll get what you submited in the other movie. 🙂

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 21, 2003, 5:28pm UTC](https://forum.kirupa.com/t/fmx-controling-another-movie/14068/3 "2003-02-21T17:28:17Z")

</div>

nice example =)

Thanks for sharing this with us 😉

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 21, 2003, 5:29pm UTC](https://forum.kirupa.com/t/fmx-controling-another-movie/14068/4 "2003-02-21T17:29:38Z")

</div>

Thanks a bunch!  
Will check/tweak it out, thanks for the attached files, very helpful!8]

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 21, 2003, 6:49pm UTC](https://forum.kirupa.com/t/fmx-controling-another-movie/14068/5 "2003-02-21T18:49:11Z")

</div>

mm ok well i’m not that advanced it seems 😕 hehe you kinda went too soon too fast for me :hangover:

I don’t really understand how i can call a MC and tell it to go to a frame and stop with that function … can you help me out?

TiA  
:trout:

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 21, 2003, 7:19pm UTC](https://forum.kirupa.com/t/fmx-controling-another-movie/14068/6 "2003-02-21T19:19:48Z")

</div>

\> I don’t really understand how i can call a MC and tell it to go to a frame and stop with that function … can you help me out?

Yeah your sending strings, however, I have seen a function called doCommand that let you execute strings:

If the parameter from sender movie is “myMC.play()”, then use doCommand:

myLocalConnection = new LocalConnection();  
myLocalConnection.onRecieve = function(parameter){  
doCommand(parameter)  
}  
myLocalConnection.connect(“IncomingMessage”);

I’ll try to get the link and post an example as well… 🙂

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 21, 2003, 7:47pm UTC](https://forum.kirupa.com/t/fmx-controling-another-movie/14068/7 "2003-02-21T19:47:52Z")

</div>

There:

Example:

MC1.play();

will play the movie! 🙂

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 21, 2003, 8:53pm UTC](https://forum.kirupa.com/t/fmx-controling-another-movie/14068/8 "2003-02-21T20:53:11Z")

</div>

thanks a million!!  
Now it’s getting clearer. Much appreciated!!\<:}

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 21, 2003, 8:54pm UTC](https://forum.kirupa.com/t/fmx-controling-another-movie/14068/9 "2003-02-21T20:54:11Z")

</div>

Glad it worked.
