Make sure that you have the swf with *unique* LC - id open only once on
your system.
SPACE or ENTER to test.
This code is tested and works:
_
paste to frame 1 in A.FLA_
LC = new LocalConnection();
LC.A_func = function(receivedParam) {
getURL("javascript:alert('[Afunc] received from id_B :
"+receivedParam+"')", "_SELF");
trace("[Afunc]"+receivedParam)
};
LC.connect("id_A"); // SELFDECLARATION
LC.send("id_B", "B_func","param-> message for id_B")
//test
KP= {}
Key.addListener(KP);
KP.onKeyDown = function(){
if(Key.isDown(Key.SPACE)){
LC.send("id_B", "B_func","param-> message for id_B")
}
}
_Then paste this to frame 1 in B.FLA
_
LC = new LocalConnection();
LC.B_func = function(receivedParam) {
getURL("javascript:alert('[Bfunc] received from id_A :
"+receivedParam+"')", "_SELF");
trace("[Bfunc]"+receivedParam)
};
LC.connect("id_B"); // SELFDECLARATION
LC.send("id_A", "A_func","param-> message for id_A")
//test
KP= {}
Key.addListener(KP);
KP.onKeyDown = function(){
if(Key.isDown(Key.ENTER)){
LC.send("id_A", "A_func","param-> message for id_A")
}
}
Now Embed them in html.
Good luck,
Latcho (whom never gets a reply ;)
Craig Aldridge wrote:
Hi coders,
I have been having a problem trying to get two swfs communicating
between them selves. I want to be able to send an id to one.swf which
access a Shared Object and then returns the required data to two.swf.
There has to be two way communication while both files are running.
I can get data one way from sender to the receiver but not back the
other way. Any one have any ideas.
Thanks in advanced Craig
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders