RE: [flexcoders] Problems with LocalConnection

2005-08-17 Thread Philippe Maegerman





mx:Button 
click="ButtonClicked()"/
Philippe 
Maegerman
Webdeveloper
+32 2 400 40 
39
+32 472 35 28 
10
Avoir des rêves, 
c'est continuer d'exister... 



From: flexcoders@yahoogroups.com 
[mailto:[EMAIL PROTECTED] On Behalf Of r_woessSent: 
mercredi 17 août 2005 14:19To: 
flexcoders@yahoogroups.comSubject: [flexcoders] Problems with 
LocalConnection
Hi,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:ApplicationFirst I opened listener.mxml in one 
browser, then I opened sender.mxmlin another broswer. After clicking on the 
button in sender.mxmlnothing happened.Has anybody an idea, why it 
doesn't work?best regardsreini





--
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.



  






--**STATEMENT OF CONFIDENTIALITY** 
This e-mail and any attached files are confidential and intended solely for the use of the individual to whom it is addressed. If you have received this email in error please send it back to the person that sent it to you. Any views or opinions presented are solely those of author and do not necessarily represent those the Emakina Company. Unauthorized publication, use, dissemination, forwarding, printing or copying of this email and its associated attachments is strictly prohibited.
We also inform you that we have checked that this message does not contain any virus but we decline any responsability in case of any damage caused by an a non detected virus.--


RE: [flexcoders] Problems with LocalConnection

2005-08-17 Thread Dirk Eismann
This looks like a scoping problem. Try this:

private function CC():Void {
  receivingLC = new LocalConnection();
  receivingLC = new LocalConnection();
  receivingLC.methodToExecute = mx.utils.Delegate.create(this, setText);
}

private function setText():Void {
  myText.text=ok;
}

Dirk.


-Original Message-
From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of r_woess
Sent: Wednesday, August 17, 2005 2:19 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Problems with LocalConnection

Hi,

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




 Yahoo! Groups Sponsor ~-- font 
face=arial size=-1a 
href=http://us.ard.yahoo.com/SIG=12haek7ii/M=362131.6882499.7825260.1510227/D=groups/S=1705007207:TM/Y=YAHOO/EXP=1124288353/A=2889191/R=0/SIG=10r90krvo/*http://www.thebeehive.org
Get Bzzzy! (real tools to help you find a job) Welcome to the Sweet Life 
- brought to you by One Economy/a./font 
~- 

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
Yahoo! Groups Links



 




 Yahoo! Groups Sponsor ~-- 
font face=arial size=-1a 
href=http://us.ard.yahoo.com/SIG=12h8gf73q/M=362329.6886308.7839368.1510227/D=groups/S=1705007207:TM/Y=YAHOO/EXP=1124290160/A=2894321/R=0/SIG=11dvsfulr/*http://youthnoise.com/page.php?page_id=1992
Fair play? Video games influencing politics. Click and talk back!/a./font
~- 

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 





RE: [flexcoders] Problems with LocalConnection

2005-08-17 Thread Dimitrios Gianninas





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
RIADeveloper
Optimal Payments Inc.



From: flexcoders@yahoogroups.com 
[mailto:[EMAIL PROTECTED] On Behalf Of r_woessSent: 
Wednesday, August 17, 2005 8:19 AMTo: 
flexcoders@yahoogroups.comSubject: [flexcoders] Problems with 
LocalConnection
Hi,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:ApplicationFirst I opened listener.mxml in one 
browser, then I opened sender.mxmlin another broswer. After clicking on the 
button in sender.mxmlnothing happened.Has anybody an idea, why it 
doesn't work?best regardsreini





--
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.