public void Invoke(string connectionName, string data = "", string methodName = "Invoke") { // wait for ack! #region rx if (rx == null) { rx = new LocalConnection(); var client = new DynamicContainer { Subject = new object() }; Action<string> Invoke = ack_data => { // http://livedocs.adobe.com/flex/3/html/help.html?content=17_Networking_and_communications_4.html if (yield != null) yield(ack_data); //content.r.Fill = Brushes.Green; }; // http://stackoverflow.com/questions/6834455/as3-localconnection-errors client["Invoke"] = Invoke.ToFunction(); rx.allowDomain("*"); rx.allowInsecureDomain("*"); rx.status += delegate { }; rx.client = client.Subject; // ArgumentError: Error #2082: Connect failed because the object is already connected. // Error #2044: Unhandled StatusEvent:. level=error, code= // If the string for connectionName begins with an underscore (for example, _connectionName), Flash Player // does not add a prefix to the string. This means the receiving and sending LocalConnection objects will // use identical strings for connectionName. If the receiving object uses LocalConnection.allowDomain() to specify that connections from any domain will be accepted, you can move the SWF file with the receiving LocalConnection object to another domain without altering any sending LocalConnection objects. rx.connect(connectionName + "_ack"); //content.MouseLeftButtonUp += // delegate // { } #endregion #region tx tx.status += delegate { }; tx.allowDomain("*"); tx.allowInsecureDomain("*"); tx.send(connectionName, methodName, data); #endregion }
public static void remove_status(LocalConnection that, Action<StatusEvent> value) { CommonExtensions.RemoveDelegate(that, value, StatusEvent.STATUS); }
public static void remove_securityError(LocalConnection that, Action<SecurityErrorEvent> value) { CommonExtensions.RemoveDelegate(that, value, SecurityErrorEvent.SECURITY_ERROR); }
public static void remove_asyncError(LocalConnection that, Action<AsyncErrorEvent> value) { CommonExtensions.RemoveDelegate(that, value, AsyncErrorEvent.ASYNC_ERROR); }
public static void InternalInvoke(Action<string> yield) { #region rx if (rx == null) { rx = new LocalConnection(); var r = new Random(); ii = r.Next(); var client = new DynamicContainer { Subject = new object() }; Action<string> Invoke = data => { //if (yield == null) // return; // http://livedocs.adobe.com/flex/3/html/help.html?content=17_Networking_and_communications_4.html //Diagnostics("InternalInvoke yield"); yield(data); //yield = null; //content.r.Fill = Brushes.Green; }; // http://stackoverflow.com/questions/6834455/as3-localconnection-errors client["Invoke"] = Invoke.ToFunction(); rx.allowDomain("*"); rx.allowInsecureDomain("*"); rx.status += delegate { }; rx.client = client.Subject; // ArgumentError: Error #2082: Connect failed because the object is already connected. // Error #2044: Unhandled StatusEvent:. level=error, code= // If the string for connectionName begins with an underscore (for example, _connectionName), Flash Player // does not add a prefix to the string. This means the receiving and sending LocalConnection objects will // use identical strings for connectionName. If the receiving object uses LocalConnection.allowDomain() to specify that connections from any domain will be accepted, you can move the SWF file with the receiving LocalConnection object to another domain without altering any sending LocalConnection objects. rx.connect("_Invoke" + ii); //content.MouseLeftButtonUp += // delegate // { } #endregion Diagnostics("NavigateTo"); new Uri("http://young-beach-4377.herokuapp.com/#c" + ii).NavigateTo(); //}; }