A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Local Connection Multiple Functions

  1. #1
    Junior Member
    Join Date
    Apr 2010

    Local Connection Multiple Functions


    I have two exe files and I am trying to control one with the other in two different windows (Sender / Reciever Windows)

    I am doing this in AS2 simply because the original set-up (single screen set-up now they want a second screen) was done awhile back in AS2 and I didn't want to recreate it...this is old and its not important to do it the best, cleanest way but just to get it done.

    I got the first function to work but can't get the second function to work and I don't know why...new to local connection function so obviously I am missing something.

    I have tried doing the Code for each button individually trying to create a new connection each time one appears and in one frame on its own layer to control all buttons on one LocalConnection as well but no luck:

    Sender Code:

    sending_lc = new LocalConnection();

    mybtn1.onRelease = function() {
    sending_lc.send("my_lc_as2", "execute_this", gotoAndPlay(2));

    mybtn2.onRelease = function() {
    sending_lc.send("my_lc_as2", "execute_this", gotoAndPlay(4));

    Reciever Code:

    receiving_lc = new LocalConnection();

    receiving_lc.execute_this = function(){



    receiving_lc.execute_this = function(){



    In essence I am trying to get buttons (6 in total) on Sender to forward the receiver exe to a new frame on release. The button "mybtn1" is working and sending the reciever movie to frame 2. The button "mybtn2" however does nothing and I am obviously not putting this together correctly.

    This is a mock-up. There are six buttons of which only one of the six are on the stage at anytime. Every time the Receiver advances to a new frame then the sender advances to a new frame as well until they finish...for the sender file the advance is a simple gotoAndPlay on the button itself.

    In all cases I get the first button to work to advance both the receiver and sender to a new frame, but not the second

    Any ideas how I can get all six of my buttons advancing both the sender to a new frame as well as the receiver? very frustrated...If you would like to see the originals let me know and I can send them. Or if you are able to mock something up in a file that has the first two buttons working and send it, then I can complete.



  2. #2
    Senior Member
    Join Date
    Jan 2011
    PHP Code:
    sending_lc = new LocalConnection();
    mybtn1.onRelease = function() {
    PHP Code:
    receiving_lc = new LocalConnection();
    receiving_lc.execute_received = function(str:String) {

    You can make in 2 way communication.

    Read for more about this:


    Last edited by arkitx; 07-23-2013 at 07:15 AM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Click Here to Expand Forum to Full Width

HTML5 Development Center