My code is a bit different that
yours, perhaps you should look at it and just change things
around:
Sender:
myConnection
= new LocalConnection();
myConnection.send("phxApp",
"messagePosted", "uploadSuccess");
Receiver:
cn = new LocalConnection();
cn.messagePosted =
Delegate.create( this, messagePosted );
cn.connect("phxApp");
public function
messagePosted( mess:Object ):Void {
if( mess
== "uploadSuccess" ) {
// do something
}
}
Dimitrios "Jimmy" Gianninas
RIA Developer
Optimal Payments Inc.
From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of r_woess
Sent: Wednesday, August 17, 2005 8:19 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Problems with LocalConnection
I want to use LocalConnection to send Data between to Flex-Windows.
I tried it with these two Files:
listener.mxml
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml"
creationComplete="CC();">
<mx:Script>
<![CDATA[
// Code in the receiving movie
public var receivingLC:LocalConnection;
private function CC():Void
{
receivingLC = new LocalConnection();
receivingLC.methodToExecute = function()
{
myText.text="ok";
}
receivingLC.allowDomain = function()
{
// Any domain can invoke methods on this LocalConnection object
return true;
}
receivingLC.connect("lc_name");
}
]]>
</mx:Script>
<mx:Text id="myText" text="----"/>
</mx:Application>
----------------------------------------------------------------------
sender.mxml
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml">
<mx:Script>
<![CDATA[
public var sendingLC:LocalConnection;
public function ButtonClicked():Void
{
sendingLC = new LocalConnection();
sendingLC.send("lc_name", "methodToExecute") ;
}
]]>
</mx:Script>
<mx:Button click="ButtonClicked"/>
</mx:Application>
First I opened listener.mxml in one browser, then I opened sender.mxml
in another broswer. After clicking on the button in sender.mxml
nothing happened.
Has anybody an idea, why it doesn't work?
best regards
reini
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
SPONSORED LINKS
Computer software testing | Macromedia flex | Development |
Software developer |
YAHOO! GROUPS LINKS
- Visit your group "flexcoders" on the web.
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.