<?xml version="1.0" encoding="iso-8859-1"?><rss version="2.0">
<channel><title><![CDATA[ActionScript.org Flash, Flex and ActionScript Resources - Comments for article: Local Connection]]></title><link>http://www.actionscript.org/resources</link><description /><language>en-us</language><copyright><![CDATA[http://www.actionscript.org/resources]]></copyright><generator>N/A</generator><webMaster>general.redirect@gmail.com</webMaster><lastBuildDate>Sun, 22 Nov 2009 10:14:53 CST</lastBuildDate><ttl>20</ttl><item><title><![CDATA[Comment #1]]></title><link>http://www.actionscript.org/resources/articles/76/1/Local-Connection/Page1.html#Comment1723</link><description><![CDATA[This article made it easy for me to get started with LocalConnection (thanks!), but I soon ran into problems.

As far as I can tell a LocalConnection can "break" if you give it enough time and especially if you do multiple sends one after the other. When I first saw this happen I assumed it was a problem in my code, but I checked carefully and found no obvious bugs. Similar problems are reported here:

http://www.kamalmeet.com/wordpress/2005/06/23/networking-in-flash/

Since the workaround suggested on this site sounded like a nightmare to code, I looked for another way to communicate between my SWFs.

I found one here:

http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=60&catid=585&threadid=1191096&highlight_key=y&keyword1=swfloader

This technique will work only if you use SWFLoader from your main SWF to create your other SWFs.

I am still a new ActionScript programmer. Sorry in advance if some of this is wrong, but I thought my finding might help other programmers avoid the lengthy (and frustrating) experience of trying to figure this out.

Thanks to those involved in creating and maintaining this great site :)

Fred Gitelman<br/><br/>
(Comment posted by Fred Gitelman at 10:19 am, Sat 24th Mar 2007)]]></description><author>no@spam.com (Fred Gitelman)</author><pubDate><![CDATA[Sat, 24 Mar 2007 10:19:05 CDT]]></pubDate><guid isPermaLink="true">http://www.actionscript.org/resources/articles/76/1/Local-Connection/Page1.html#Comment1723</guid></item><item><title><![CDATA[Comment #2]]></title><link>http://www.actionscript.org/resources/articles/76/1/Local-Connection/Page1.html#Comment5599</link><description><![CDATA[Interesting article, and really handly tool for talking between two swf's. Just wish there was a way to accommodate for multiple instances of the same flash files being open at the same time, such as a user browsing your site in two windows at once...<br/><br/>
(Comment posted by Mike Walker at 3:31 pm, Thu 23rd Aug 2007)]]></description><author>no@spam.com (Mike Walker)</author><pubDate><![CDATA[Thu, 23 Aug 2007 15:31:07 CDT]]></pubDate><guid isPermaLink="true">http://www.actionscript.org/resources/articles/76/1/Local-Connection/Page1.html#Comment5599</guid></item><item><title><![CDATA[Comment #3]]></title><link>http://www.actionscript.org/resources/articles/76/1/Local-Connection/Page1.html#Comment6446</link><description><![CDATA[nice, how about if in the "outcoming.swf" contains buttons and in the "incoming.swf" contains each movies. My question is how to get button "a" to play movie "a" in the incoming.swf?

Many thanks,<br/><br/>
(Comment posted by herrjunge at 8:15 pm, Tue 2nd Oct 2007)]]></description><author>no@spam.com (herrjunge)</author><pubDate><![CDATA[Tue, 02 Oct 2007 20:15:42 CDT]]></pubDate><guid isPermaLink="true">http://www.actionscript.org/resources/articles/76/1/Local-Connection/Page1.html#Comment6446</guid></item><item><title><![CDATA[Comment #4]]></title><link>http://www.actionscript.org/resources/articles/76/1/Local-Connection/Page1.html#Comment7873</link><description><![CDATA[hey i got a movie to play in the incoming swf by telling the outgoing swf to send a variable.. say '1'
then in the incoming swf i replaced the script with: 

incoming_lc.methodToExecute = function(param:String):Void  {
	if (param = "1") {
		_root.ball.play(1);
	}
};

hope this helps<br/><br/>
(Comment posted by andrew at 4:42 pm, Thu 29th Nov 2007)]]></description><author>no@spam.com (andrew)</author><pubDate><![CDATA[Thu, 29 Nov 2007 16:42:14 CST]]></pubDate><guid isPermaLink="true">http://www.actionscript.org/resources/articles/76/1/Local-Connection/Page1.html#Comment7873</guid></item><item><title><![CDATA[Comment #5]]></title><link>http://www.actionscript.org/resources/articles/76/1/Local-Connection/Page1.html#Comment12304</link><description><![CDATA[i found this article helpful to get me started.  But I ran into a problem on Macs if I use more than 7 instance of a button that uses a local connection to communicate with a control swf that keeps track of the buttons' states and updates them.  I found that this problem does not happen on Windows machines.  Is this a known problem with local connections and Macs?<br/><br/>
(Comment posted by kmcg at 2:38 pm, Sat 22nd Nov 2008)]]></description><author>no@spam.com (kmcg)</author><pubDate><![CDATA[Sat, 22 Nov 2008 14:38:05 CST]]></pubDate><guid isPermaLink="true">http://www.actionscript.org/resources/articles/76/1/Local-Connection/Page1.html#Comment12304</guid></item><item><title><![CDATA[Comment #6]]></title><link>http://www.actionscript.org/resources/articles/76/1/Local-Connection/Page1.html#Comment12805</link><description><![CDATA[Reminding me that I should close my LocalConnection with "this.close(),  was very helpful, thanks!<br/><br/>
(Comment posted by Ron Fredericks at 10:55 am, Tue 24th Mar 2009)]]></description><author>no@spam.com (Ron Fredericks)</author><pubDate><![CDATA[Tue, 24 Mar 2009 10:55:41 CDT]]></pubDate><guid isPermaLink="true">http://www.actionscript.org/resources/articles/76/1/Local-Connection/Page1.html#Comment12805</guid></item><item><title><![CDATA[Comment #7]]></title><link>http://www.actionscript.org/resources/articles/76/1/Local-Connection/Page1.html#Comment12807</link><description><![CDATA[Reminding me that I should close my LocalConnection with "this.close() was very helpful, thanks!  

The only think I might add, is to include a try/catch code block like this:


var receiver:DynamicLocalConnection = new DynamicLocalConnection();
try {
	receiver.connect("_myBroadcastChannel");
} catch (e:Error) {
	trace("receiver named _myBroadcastChannel already claimed by another copy of this movie:\n" + e);
	errorHandler(String(e), "Autoplay has been skipped", 0xFF0000);
}
receiver.playNow = function():void {
	trace("communication received");
	my_flvAutoplayFlag = true;  // activate my_FLVPlybk.play on next interval of timer tick in myRepeatingFunction
	delete receiver.example;
	this.close();  // use this method to insure that receiver can be re-used in another movie instance.
};

function errorHandler(e:String, errorLevel:String, errorColor:Number):void {
	// removed to shorten this example
}<br/><br/>
(Comment posted by Ron Fredericks at 3:15 pm, Tue 24th Mar 2009)]]></description><author>no@spam.com (Ron Fredericks)</author><pubDate><![CDATA[Tue, 24 Mar 2009 15:15:44 CDT]]></pubDate><guid isPermaLink="true">http://www.actionscript.org/resources/articles/76/1/Local-Connection/Page1.html#Comment12807</guid></item></channel></rss>