Facilitates External Interface communication between a .NET application and a Shockwave Flash ActiveX control by providing an abstraction layer over the XML-serialized data format used by Flash Player for ExternalInterface communication. This class provides the Call method for calling ActionScript functions and raises the ExternalInterfaceCall event when calls come from ActionScript.
Пример #1
0
        public KanColleConsole()
        {
            InitializeComponent();

            // Read in the swf file.
            string swfPath = System.IO.Directory.GetCurrentDirectory() + "\\api_port.swf";
            this.flash.LoadMovie(0, swfPath);

            // Set up the proxy for the flash file.
            this.proxy = new ExternalInterfaceProxy(this.flash);
        }
Пример #2
0
        // Stuff here taken from WPF tutorial
        // https://msdn.microsoft.com/en-us/library/ms751761%28v=vs.110%29.aspx
        private void RunExpKai_Loaded(object sender, RoutedEventArgs e)
        {
            // Create the interop host control.
            System.Windows.Forms.Integration.WindowsFormsHost host = new System.Windows.Forms.Integration.WindowsFormsHost();

            // Create Shockwave Flash control.
            AxShockwaveFlash flash = new AxShockwaveFlash();

            // Assign the shockwave flash control as the host control's child.
            host.Child = flash;

            // Add the interop host control to the Grid
            // control's collection of child controls.
            this.grid_winformshost.Children.Add(host);

            string swf_path = System.IO.Directory.GetCurrentDirectory() + "\\api_port.swf";
            flash.Location = new System.Drawing.Point(0, 0);
            flash.LoadMovie(0, swf_path);
            flash.AllowScriptAccess = "always";

            this.flashproxy = new ExternalInterfaceProxy(flash);

            //string msg = this.flashproxy.Call("api_mission", null).ToString();
        }