13 Replies Latest reply on Sep 21, 2009 4:52 PM by kglad

    LocalConnection issues- works great and then fails

    Lauren60660 Level 1

      I'm having trouble with LocalConnection.  I'm using it to have a button in the main swf file control another sub swf file.

       

      This is my AS2 in the main swf:

       

      outgoing_lc = new LocalConnection();


      about_btn.onRelease = function() {

      outgoing_lc.send("lc_example", "methodToExecute", "../assets/flash/buenosaires_text.swf");

      gotoAndStop(2);


      };


      hide_btn.onRelease = function() {

      outgoing_lc.send("lc_example", "methodToExecute", "../assets/flash/empty.swf");

      gotoAndStop(1);


      };

       

      Basically I'm telling the button in main to load a movie in the sub swf with about_btn and then go to frame 2 in the main swf, then when they hit the other button, it loads a different movie and goes back to frame 1 in the main swf file.  The sub swf is basically empty with a holder movie in it and this AS2:

       

      incoming_lc = new LocalConnection();

      incoming_lc.connect("lc_example");

      incoming_lc.methodToExecute = function(param){

      holder.loadMovie(param);

      };

       

      The two movies buenosaires_text.swf and empty.swf have content but no actionscript.  Also- it might be worth noting that I have 4 pages on the site that have this action taking place, but they are 4 separate html pages that house the swfs.

       

      It worked great, and then became unstable as it was tested more and more, it would work and then the user would navigate back to it and try the buttons again and they wouldn't work.  All is remedied when the browser is refreshed, but you can't put a disclaimer on a site to have the user refresh every time it stops working. (this site has been tested on 2 different servers and locally all with the same outcome)

       

      Any help would be greatly appreciated... I've been killing myself over this and my inability to figure out what is wrong with my apparently possessed script.