Beispiel #1
0
        static void RunSwf(string path)
        {
            if (!Path.IsPathRooted(path))
            {
                path = Path.Combine(Environment.CurrentDirectory, path);
            }

            var results = FlashPlayer.Run(path);

            if (results.Timeout)
            {
                Console.WriteLine("TIMEOUT!");
                Environment.Exit(-1);
            }

            string output = TrimOutput(results.Output);

            if (XmlConsole)
            {
                Console.WriteLine(output);
            }
            else
            {
                if (string.IsNullOrEmpty(XmlPath))
                {
                    XmlPath = Path.ChangeExtension(path, ".xml");
                }
                File.WriteAllText(XmlPath, output);
                Transform(XmlPath);
            }
        }
Beispiel #2
0
        static void RunPlayer(Test test, string path_swf)
        {
            var results = FlashPlayer.Run(path_swf);

            test.Output   = TrimOutput(results.Output);
            test.Success  = results.Success;
            test.Time     = results.Time / 1000.0;
            test.Executed = !results.NotRun;
            test.ExitCode = results.ExitCode;
        }
Beispiel #3
0
    // Use this for initialization
    void Start()
    {
        head     = GameObject.FindGameObjectWithTag("Head");
        headRend = head.GetComponent <MeshRenderer>();

        movement = GetComponent <Movement>();
        jump     = GetComponent <Jump>();
        flash    = GetComponent <FlashPlayer>();

        isSquatting = false;
    }
Beispiel #4
0
    // Use this for initialization
    void Start()
    {
        blocks = GameObject.FindGameObjectsWithTag("Ball");

        flash    = GetComponent <FlashPlayer>();
        hud      = GetComponent <HUD>();
        movement = GetComponent <Movement>();

        leftHandDif  = 0.0f;
        rightHandDif = 0.0f;
    }
 public void OnReady()
 {
     isReady = true;
     if (pendingInit != null)
     {
         FlashHost.SetStyleAttribute("width", pendingInit.width.ToString() + "px");
         FlashHost.SetStyleAttribute("height", pendingInit.height.ToString() + "px");
         FlashPlayer.Invoke("initAd", FlashPluginWidth, FlashPluginHeight, pendingInit.viewMode, pendingInit.desiredBitrate, pendingInit.creativeData, pendingInit.environmentVariables);
         pendingInit = null;
     }
 }
 // Use this for initialization
 void Start()
 {
     player   = GameObject.FindGameObjectWithTag("Player");
     movement = player.GetComponent <Movement>();
     flash    = player.GetComponent <FlashPlayer>();
     squat    = player.GetComponent <Squat>();
     jump     = player.GetComponent <Jump>();
     hud      = player.GetComponent <HUD>();
     bounds   = new Bounds(new Vector3(transform.position.x, transform.position.y, transform.position.z),
                           new Vector3(transform.localScale.x, transform.localScale.y, transform.localScale.z));
 }
Beispiel #7
0
    // Use this for initialization
    void Start()
    {
        blocks = GameObject.FindGameObjectsWithTag("Ball");

        flash = GetComponent<FlashPlayer>();
        hud = GetComponent<HUD>();
        movement = GetComponent<Movement>();

        leftHandDif = 0.0f;
        rightHandDif = 0.0f;
    }
 // Use this for initialization
 void Start()
 {
     player = GameObject.FindGameObjectWithTag("Player");
     movement = player.GetComponent<Movement>();
     flash = player.GetComponent<FlashPlayer>();
     squat = player.GetComponent<Squat>();
     jump = player.GetComponent<Jump>();
     hud = player.GetComponent<HUD>();
     bounds = new Bounds(new Vector3(transform.position.x, transform.position.y, transform.position.z),
                         new Vector3(transform.localScale.x, transform.localScale.y, transform.localScale.z));
 }
Beispiel #9
0
    // Use this for initialization
    void Start()
    {
        head = GameObject.FindGameObjectWithTag("Head");
        headRend = head.GetComponent<MeshRenderer>();

        movement = GetComponent<Movement>();
        jump = GetComponent<Jump>();
        flash = GetComponent<FlashPlayer>();

        isSquatting = false;
    }
Beispiel #10
0
 public MainForm()
 {
     InitializeComponent();
     this.Wpr          = new FlaWndProc(this.FlashWndProc);
     this.OldWndProc   = SetWindowLong(FlashPlayer.Handle, GWL_WNDPROC, Wpr); //关联flash控件
     FlashPlayer.Movie = BaseDirectory + "\\f21.swf";
     FlashPlayer.Play();
     this.StartPosition = FormStartPosition.CenterScreen;
     Application.Idle  += new EventHandler(Application_Idle);
     m_pMainWnd         = this;
 }
Beispiel #11
0
 // Use this for initialization
 void Start()
 {
     player   = GameObject.FindGameObjectWithTag("Player");
     movement = player.GetComponent <Movement>();
     squat    = player.GetComponent <Squat>();
     jump     = player.GetComponent <Jump>();
     flash    = player.GetComponent <FlashPlayer>();
     head     = GameObject.FindGameObjectWithTag("Head");
     headRend = head.GetComponent <MeshRenderer>();
     rend     = gameObject.GetComponent <MeshRenderer>();
     children = gameObject.GetComponentsInChildren <MeshRenderer>();
     bounds   = new Bounds(new Vector3(transform.position.x, transform.position.y, transform.position.z),
                           new Vector3(transform.localScale.x, transform.localScale.y, transform.localScale.z));
 }
        private void InitializeComponent()
        {
            this.shockwaveFlash = new FlashPlayer();
            this.SuspendLayout();

            this.shockwaveFlash.Enabled           = true;
            this.shockwaveFlash.Location          = new System.Drawing.Point(27, 43);
            this.shockwaveFlash.Name              = "shockwaveFlash";
            this.shockwaveFlash.Size              = new System.Drawing.Size(192, 192);
            this.shockwaveFlash.Dock              = DockStyle.Fill;
            this.shockwaveFlash.TabIndex          = 0;
            this.shockwaveFlash.AllowScriptAccess = "always";
            this.shockwaveFlash.FlashCall        += new FlashCallEventHandler(shockwaveFlash_FlashCall);

            this.Controls.Add(shockwaveFlash);
            this.ResumeLayout();
        }
Beispiel #13
0
 public IObject DeepCopy()
 {
     var flash = new FlashPlayer
         {
             Source = Flash.Source,
             Width = Width,
             Height = Height
         };
     flash.FlashLoadMovie();
     flash.FlashStop();
     flash.FlashLoop(false);
     var newFlash = new FlashAnimation
         {
             Height = Height,
             Width = Width,
             ObjectName = Utilities.GiveUniqueName(flash.Source),
             ObjectPath = flash.Source.LocalPath,
         };
     newFlash.Children.Clear();
     newFlash.Children.Add(flash);
     return newFlash;
 }
Beispiel #14
0
        private static void Execute(TestCase test, TestDriverSettings settings)
        {
            if (test.IsBenchmark)
            {
                if (settings.IsSWF)
                {
                    var results = FlashPlayer.Run(test.OutputPath);
                    test.Output2 = results.Output;
                    return;
                }

                throw new NotImplementedException();
            }

            int exitCode1 = 0;

            if (!test.HasOutput)
            {
                test.VM      = VM.CLR;
                test.Output1 = CommandPromt.Run(test.ExePath, "", out exitCode1);
            }
            else
            {
                test.Output1 = test.Output;
            }

            int exitCode2;

            if (settings.IsClrEmulation)
            {
                try
                {
                    var console = new StringWriter();
                    var vm      = new VirtualMachine(console);
                    exitCode2    = vm.Run(test.ExePath, "", new string[0]);
                    test.Output2 = console.ToString();
                }
                catch (Exception e)
                {
                    exitCode2    = 0;
                    test.Output2 = e.ToString();
                }
            }
            else if (settings.IsJavaScript)
            {
                try
                {
                    test.Output2 = JsRunner.Run(test.OutputPath, null, out exitCode2);
                }
                catch (Exception e)
                {
                    exitCode2    = 0;
                    test.Output2 = e.ToString();
                }
            }
            else if (settings.IsABC)
            {
                var avmOpts = new AvmShell.Options();
                test.Output2 = AvmShell.Run(avmOpts, out exitCode2, test.OutputPath);
            }
            else if (settings.IsSWF)
            {
                //tc.Output2 = FlashShell.Run(outpath, out exitCode2);
                FlashPlayer.Path = @"c:\pfx\tools\fp10.exe";
                var results = FlashPlayer.Run(test.OutputPath);
                exitCode2    = results.ExitCode;
                test.Output2 = results.Output;
            }
            else
            {
                throw new NotImplementedException();
            }

            CreateDebugHooks(test, settings, test.OutputPath);

            if (test.CheckExitCode)
            {
                if (exitCode2 != 0)
                {
                    test.Error = string.Format("{0} returned non zero exit code {1}.",
                                               test.OutputPath, exitCode2);
                    return;
                }
                if (exitCode1 != 0)
                {
                    test.Error = string.Format("{0} returned non zero exit code {1}.",
                                               test.ExePath, exitCode1);
                    return;
                }
            }

            if (test.CompareOutputs)
            {
                test.Error = CompareTools.CompareLines(test.Output1, test.Output2, true);
            }
        }
 public void ThenICanSeeFlashSRegistry()
 {
     Assert.True(FlashPlayer.assertFlashPlayer());
 }
 public void GivenISeeFlashPlayerIsInstalled()
 {
     FlashPlayer.findRegistryKey();
 }
Beispiel #17
0
 // Use this for initialization
 void Start()
 {
     player = GameObject.FindGameObjectWithTag("Player");
     movement = player.GetComponent<Movement>();
     squat = player.GetComponent<Squat>();
     jump = player.GetComponent<Jump>();
     flash = player.GetComponent<FlashPlayer>();
     head = GameObject.FindGameObjectWithTag("Head");
     headRend = head.GetComponent<MeshRenderer>();
     rend = gameObject.GetComponent<MeshRenderer>();
     children = gameObject.GetComponentsInChildren<MeshRenderer>();
     bounds = new Bounds(new Vector3(transform.position.x, transform.position.y, transform.position.z),
                         new Vector3(transform.localScale.x, transform.localScale.y, transform.localScale.z));
 }