0 Replies Latest reply on Apr 21, 2010 7:55 AM by Sunil Kumar Sah

    Cross domain scripting at run time using local connection flash AS2

    Sunil Kumar Sah Level 1

      Hi

           I want to do live video streaming using FMS and FMLE in Flash As2. Suppose 100 users watching video online and I want to show message to  all 100 users using the Local connection.

       

      If I am sending message using different browser in same pc then I can get the message which was send from another swf file but I am checking from another pc then message not coming in receiver swf file.

       

       

      Please find the code below. 

       

      receievemovie.swf

       

      // Code in the receiving SWF file

      this.createTextField("result_txt", 1, 10, 10, 100, 22);

      System.security.allowDomain("*")

      System.security.allowInsecureDomain("*")

       

      var my_lc:LocalConnection = new LocalConnection();

      my_lc.allowDomain = function(sendingDomain:String) {

      domain_txt.text = sendingDomain;

      return true;

      };

      my_lc.allowDomain = function(sendingDomain:String) {

      return (sendingDomain == "*");

      }

      my_lc.allowInsecureDomain = function(sendingDomain:String) {

      return (sendingDomain == "*");

      }

       

      my_lc.methodToExecute = function(param1:String) {

          result_txt.text = param1

      myResult.text=param1

      };

      my_lc.connect("lc_name");

       

      ------------------------------------------------------------------------------------------ -------------------------------------

      sendmovie.swf

       

      System.security.allowDomain("*")

      System.security.allowInsecureDomain("*")

      var sending_lc:LocalConnection;

      var sending_lc:LocalConnection = new LocalConnection();

      sending_lc.allowDomain = function(sendingDomain:String) {

      return (sendingDomain == "*");

      }

      sending_lc.allowInsecureDomain = function(sendingDomain:String) {

      return (sendingDomain == "*");

      }

       

       

       

      myButton.onRelease = function(){

      sending_lc = new LocalConnection();

      sending_lc.send("lc_name", "methodToExecute", sendMsg.text);

      sendMsg.text="Message has been sent"

      }

      If you have any other way to do it please suggest me to do that.
      Thanks & regards
      Sunil Kumar