# localConnection problem

**URL:** https://forum.kirupa.com/t/localconnection-problem/265371
**Category:** flash
**Created:** [July 8, 2008, 6:17am UTC](https://forum.kirupa.com/t/localconnection-problem/265371 "2008-07-08T06:17:56Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![buzbuz](https://avatars.discourse-cdn.com/v4/letter/b/5daacb/32.png) [@buzbuz](https://forum.kirupa.com/u/buzbuz)
#### Post date: [July 8, 2008, 6:17am UTC](https://forum.kirupa.com/t/localconnection-problem/265371/1 "2008-07-08T06:17:56Z")

</div>

[COLOR=#191970]Hello.[/COLOR]  
[COLOR=#191970]  
On one page, there are two swf files, which need to connect to eachother and send variables … now that is easy, but the tricky part is that localConnection does not work when one swf is located on the server, and the other swf is located on the client! They are both opened from the client machine, but each is located in a different computer.[/COLOR]  
[FONT=Verdana, Arial, Helvetica][SIZE=2][COLOR=#191970][/COLOR][/SIZE][/FONT]  
[FONT=Verdana, Arial, Helvetica][SIZE=2][COLOR=#191970]I have tried **System.security.allowDomain("\*")** even specified an IP for it, still does not work![/COLOR][/SIZE][/FONT]  
[COLOR=#191970][/COLOR]  
[FONT=Verdana, Arial, Helvetica][SIZE=2][COLOR=midnightblue]What should one do here ? I’d apreciate the help guys :stare:[/COLOR][/SIZE][/FONT]

---

<div class="post-metadata">

### Author: ![buzbuz](https://avatars.discourse-cdn.com/v4/letter/b/5daacb/32.png) [@buzbuz](https://forum.kirupa.com/u/buzbuz)
#### Post date: [July 8, 2008, 6:58am UTC](https://forum.kirupa.com/t/localconnection-problem/265371/2 "2008-07-08T06:58:35Z")

</div>

Actionscript in receiving swf:  
stop();  
var receivingLC:LocalConnection = new LocalConnection();  
receivingLC.methodToExecute = function(varReceived) {  
var myVar = varReceived;  
if (myVar == “red”) {  
trace(“red pressed”);  
}  
else if (myVar == “green”) {  
trace(“green pressed”);  
}  
else if (myVar == “yellow”) {  
trace(“yellow pressed”);  
}  
};  
receivingLC.connect(“LC\_slideshow”);

Actionscript in sending swf:  
function slideNav(parameter1) {  
switch (\_root.blaBla) {  
case “PrevSlide” :  
// prev slide in slideshow  
var sendingLC = new LocalConnection();  
sendingLC.send(“LC\_slideshow”,“methodToExecute”,“r ed”);  
break;  
case “NextSlide” :  
// next slide in slideshow  
var sendingLC = new LocalConnection();  
sendingLC.send(“LC\_slideshow”,“methodToExecute”,“y ellow”);  
break;  
case “PausePlaySlide” :  
// pause and play slide in slideshow  
var sendingLC = new LocalConnection();  
sendingLC.send(“LC\_slideshow”,“methodToExecute”,“g reen”);  
break;  
}  
}

I am sure the actionscript is clean, it works in more than 30pages. and both swfs are running on the same page, but their directories are on seperate pcs. I’m still stuck, it still doesnt work

---

<div class="post-metadata">

### Author: ![krilnon](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/krilnon/32/34_2.png) [@krilnon](https://forum.kirupa.com/u/krilnon)
#### Post date: [July 8, 2008, 11:14am UTC](https://forum.kirupa.com/t/localconnection-problem/265371/3 "2008-07-08T11:14:20Z")

</div>

> [@AS Docs](#):
>
> By default, Flash Player resolves connectionName into a value of “superdomain:connectionName”, where superdomain is the superdomain of the SWF file containing the LocalConnection.connect() command. For example, if the SWF file containing the receiving LocalConnection object is located at [www.someDomain.com](http://www.someDomain.com), connectionName resolves to “[someDomain.com](http://someDomain.com):connectionName”. (If a SWF file is located on the client computer, the value assigned to superdomain is “localhost”.)

Based on the above information, I think that you’ll need to change the receivingLC._connect_ call so that the connection name has a prefix for the superdomain. It’s either going to be “localhost” or the IP of the server, unless you’re referring to the server by its domain name if it’s online, or something.

---

<div class="post-metadata">

### Author: ![buzbuz](https://avatars.discourse-cdn.com/v4/letter/b/5daacb/32.png) [@buzbuz](https://forum.kirupa.com/u/buzbuz)
#### Post date: [July 8, 2008, 2:31pm UTC](https://forum.kirupa.com/t/localconnection-problem/265371/4 "2008-07-08T14:31:40Z")

</div>

> [@Krilnon;2355154](#):
>
> Based on the above information, I think that you’ll need to change the receivingLC._connect_ call so that the connection name has a prefix for the superdomain. It’s either going to be “localhost” or the IP of the server, unless you’re referring to the server by its domain name if it’s online, or something.

After reading this, i went and studied the superdomain issues, and it now works!! The problem turned to be a superdomain problem. Thank you
