/// <summary>
        /// Called when Flash Player raises the FlashCallEvent (when an External Interface call
        /// is made by ActionScript)
        /// </summary>
        /// <param name="sender">The object raising the event</param>
        /// <param name="e">The arguments for the event</param>
        private void _flashControl_FlashCall(object sender, _IShockwaveFlashEvents_FlashCallEvent e)
        {
            ExternalInterfaceCall          functionCall = ExternalInterfaceSerializer.DecodeInvoke(e.request);
            ExternalInterfaceCallEventArgs eventArgs    = new ExternalInterfaceCallEventArgs(functionCall);
            object response = OnExternalInterfaceCall(eventArgs);

            _flashControl.SetReturnValue(ExternalInterfaceSerializer.EncodeResult(response));
        }
 /// <summary>
 /// Calls the ActionScript function which is registered as a callback method with the
 /// ActionScript ExternalInterface class.
 /// </summary>
 /// <param name="functionName">The function name registered with the ExternalInterface class
 /// corresponding to the ActionScript function that is to be called</param>
 /// <param name="args">Additional arguments, if any, to pass to the ActionScript function.</param>
 /// <returns>The result returned by the ActionScript function, or null if no result is returned.</returns>
 /// <exception cref="System.Runtime.Interop.COMException">Thrown when there is an error
 /// calling the method on Flash Player. For instance, this exception is raised if the
 /// specified function name is not registered as a callable function with the ExternalInterface
 /// class; it is also raised if the ActionScript method throws an Error.</exception>
 public object Call(string functionName, params object[] arguments)
 {
     try
     {
         string request  = ExternalInterfaceSerializer.EncodeInvoke(functionName, arguments);
         string response = _flashControl.CallFunction(request);
         object result   = ExternalInterfaceSerializer.DecodeResult(response);
         return(result);
     }
     catch (COMException)
     {
         throw;
     }
 }
 /// <summary>
 /// Called when Flash Player raises the FlashCallEvent (when an External Interface call
 /// is made by ActionScript)
 /// </summary>
 /// <param name="sender">The object raising the event</param>
 /// <param name="e">The arguments for the event</param>
 private void _flashControl_FlashCall(object sender, _IShockwaveFlashEvents_FlashCallEvent e)
 {
     try
     {
         ExternalInterfaceCall          functionCall = ExternalInterfaceSerializer.DecodeInvoke(e.request);
         ExternalInterfaceCallEventArgs eventArgs    = new ExternalInterfaceCallEventArgs(functionCall);
         object response = OnExternalInterfaceCall(eventArgs);
         _flashControl.SetReturnValue(ExternalInterfaceSerializer.EncodeResult(response));
     }
     catch (Exception ex)
     {
         Logger.DEBUG_TRACE("_flashControl_FlashCall Exception:" + ex.Message + "\n");
     }
 }
 /// <summary>
 /// Calls the ActionScript function which is registered as a callback method with the
 /// ActionScript ExternalInterface class.
 /// </summary>
 /// <param name="functionName">The function name registered with the ExternalInterface class
 /// corresponding to the ActionScript function that is to be called</param>
 /// <param name="args">Additional arguments, if any, to pass to the ActionScript function.</param>
 /// <returns>The result returned by the ActionScript function, or null if no result is returned.</returns>
 /// <exception cref="System.Runtime.Interop.COMException">Thrown when there is an error
 /// calling the method on Flash Player. For instance, this exception is raised if the
 /// specified function name is not registered as a callable function with the ExternalInterface
 /// class; it is also raised if the ActionScript method throws an Error.</exception>
 public Object Call(String functionName, params Object[] arguments)
 {
     try
     {
         Trace.WriteLine("ExternalInterfaceProxy.Call:EncodeInvoke\n");
         string request = ExternalInterfaceSerializer.EncodeInvoke(functionName, arguments);
         Trace.WriteLine("ExternalInterfaceProxy.Call:CallFunction-" + request + "\n");
         string response = _flashControl.CallFunction(request);
         Trace.WriteLine("ExternalInterfaceProxy.Call:DecodeResult\n");
         object result = ExternalInterfaceSerializer.DecodeResult(response);
         return(result);
     }
     catch (COMException)
     {
         Trace.WriteLine("ExternalInterfaceProxy.Call:COMException\n");
         throw;
     }
 }