From 63fe70c5117030872fbd2ea07bdc1f1a81d2d511 Mon Sep 17 00:00:00 2001 From: Lako Date: Sat, 2 Jan 2021 11:06:01 -0500 Subject: [PATCH] Further work on AS3 --- OpenFK/Form1.cs | 73 ++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 66 insertions(+), 7 deletions(-) diff --git a/OpenFK/Form1.cs b/OpenFK/Form1.cs index 97b8415..4514939 100644 --- a/OpenFK/Form1.cs +++ b/OpenFK/Form1.cs @@ -107,8 +107,8 @@ namespace OpenFK AS3Container.Quality = Settings.Default.Quality; AS3Container.ScaleMode = Settings.Default.ScaleMode; AS3Container.Movie = Directory.GetCurrentDirectory() + @"\MainAS3.swf"; //Sets MainAS3.swf as the Flash Movie to Play. - AS3Container.Play(); Debug.WriteLine("MainAS3.swf is Loaded"); + AS3Container.FSCommand += new _IShockwaveFlashEvents_FSCommandEventHandler(flashPlayerAS3_FSCommand); AS3Container.FlashCall += new _IShockwaveFlashEvents_FlashCallEventHandler(flashPlayerAS3_FlashCall); } catch @@ -149,6 +149,36 @@ namespace OpenFK //End of USB Initialization } + private void flashPlayerAS3_FSCommand(object sender, _IShockwaveFlashEvents_FSCommandEvent e) + { + Debug.WriteLine("AS3 COMMAND! - " + e.command + " " + e.args); + if(e.args.Contains("save_jpeg0"); //Gives result to game. + } + } + + if (e.args.Contains(""); setVar(@""); - } + setVar(@""); + } + + if (e.args.Contains(""); //Tells the AS3 game to end. + AS3Container.SendToBack(); //Returns to AS2 container. + AS3Container.Stop(); + } + + if(e.args.Contains("" is the string. Unsure if it does anything, but it does not give a failure. + AS3Container.CallFunction(@"setid%3c%63%6f%6d%6d%61%6e%64%73%3e%3c%73%65%74%69%64%20%69%64%3d%22%30%22%20%2f%3e%3c%2f%63%6f%6d%6d%61%6e%64%73%3e%3c%63%6f%6d%6d%61%6e%64%73%3e%3c%73%65%74%69%64%20%69%64%3d%22%30%22%20%2f%3e%3c%2f%63%6f%6d%6d%61%6e%64%73%3e"); + AS3Container.SendToBack(); + Directory.Delete(Directory.GetCurrentDirectory() + @"\misc\tmp\", true); //Deletes the temporary folder used for the results. + } + + if (e.args.Contains(""); + setVar(@""); } if (e.CloseReason == CloseReason.WindowsShutDown) //If windows is shutting down {