send_mouse_move_to_flash_player

send_mouse_move_to_flash_player($x,$y,$flash_num,$bUseFlashXY=false,$scroll=true); - this function is used to send mouse cursor movement to the flash element on the current page

The function accepts parameters as input:

  • $x – x - coordinate of the point to move the mouse cursor to. (int)
  • $y – y - coordinate of the point to move the mouse cursor to. (int)
  • $flash_num – number of the flash element on the current page. (int)
  • $bUseFlashXY – use the coordinates of the flash element. If true, the $x and $y parameters pass coordinates relative to the upper - left corner of the flash, and if false – relative to the upper-left corner of the browser (boolean)
  • $scroll - whether to scroll the browser to the specified point. If false, it will simply move to the specified point. if true, it will automatically scroll to the specified point (boolean).

    If the coordinates are empty, the click is made at the current point.

    After testing, the function returns the result of its work to the script :
  • true – successfully moved the cursor to the specified point (boolean)
  • false – operation failed (boolean)

    PHP example:

    <?php $xhe_host = "127.0.0.1:7010";
     
    //connect the object to control the emulator, if not already connected
    if(!isset($path))
      $path = "../../../Templates/xweb_human_emulator.php";
    require($path);
     
    //Start
    echo "<hr> <font color = blue> mouse->".basename(__FILE__)."</font> <hr>";
     
    //1
    echo "1.Go to the polygon:";
    echo $browser->navigate('http://humanemulator.net/poligon/embed.html')." n"; sleep(3);
     
    //move the mouse to the flash player
    $mouse->move(300,160,1,2);
     
    //2
    echo "2.Send click to flash at browser coordinate(play video):";
    echo $mouse->send_click_to_flash_player(300,160,0, false)." n"; sleep(10);
     
    //3
    echo "3.Get coordinates relative to the flash player:";
    echo $mouse->get_mouse_pos_to_flash_player(0,300,160)." n";
     
    //4
    echo "4.Send a left mouse button click event on the player coordinates:";
    echo $mouse->send_click_to_flash_player(290,150,0, true)." n";
     
    //five
    echo "5.Get the coordinates relative to the flash player for the current cursor position(the cursor must be in the play area):";
    echo $mouse->get_mouse_pos_to_flash_player(0)." n  n";
     
    //end
    echo "<hr> <br>";
     
    //Quit
    $app->quit();
    ?>

    Python example:

    # Additional paths
    import sys
    sys.path.insert(0, '../../../Templates PY/')
     
    xhe_host = "127.0.0.1:7011"
    from xweb_human_emulator import *
     
    # Start
    echo("<hr> <font color = blue> mouse.xxxxxxxxx </font> <hr>")
     
    # 1
    echo("1.Go to polygon:")
    echo(browser.navigate('http://humanemulator.net/poligon/embed.html'), "
    ")
    sleep(3)
     
    # move the mouse pho flash player
    mouse.move(300,160,1,2)
     
    # 2
    echo("2.Send click to flash at browser coordinate(play video):")
    echo(mouse.send_click_to_flash_player(300,160,0, false), "
    ")
    sleep(10)
     
    # 3
    echo("3.Get coordinates relative to flash player:")
    echo(mouse.get_mouse_pos_to_flash_player(0,300,160), "
    ")
     
    # 4
    echo("4.Send a left mouse button click event on the player coordinates:")
    echo(mouse.send_click_to_flash_player(290,150,0, true), "
    ")
     
    # five
    echo("5.Get the coordinates relative to the flash player for the current cursor position(the cursor must be in the play area):")
    echo(mouse.get_mouse_pos_to_flash_player(0), "
     
    ")
     
    # end
    echo("<hr> <br>")
     
    # Quit
    app.quit()

    C# example:

    #region using
     
    using System;
    using System.Diagnostics;
    using System.Collections.Generic;
    using System.Linq;
    using System.IO;
    using System.Text;
    using System.Threading;
     
    using XHE;
    using XHE.XHE_DOM;
    using XHE.XHE_System;
    using XHE.XHE_Window;
    using XHE.XHE_Web;
     
    #endregion
     
     class Program: XHEScript
     {
    static void Main(string [] args)
    {
    //init XHE
    server = "127.0.0.1:7010";
    InitXHE();
     
    //Start
    echo("<hr> <font color = blue> mouse.send_mouse_move_to_flash_player </font> <hr>");
     
    //go to polygon
    browser.navigate('http://humanemulator.net/poligon/embed.html');
    browser.wait_for(60,1);
     
    //send a move event at the browser coordinate
    echo("mouse.send_mouse_move_to_flash_player(300,200,1, false);
    sleep(3);
    echo("<br>");
     
    //get coordinates relative to flash player
    echo("mouse.get_mouse_pos_to_flash_player(1, x =" 300 ", y =" 200 ");
    echo("<br>");
     
    //send a move event at the coordinates of the flash player
    echo("mouse.send_mouse_move_to_flash_player(290,185,1, true);
    sleep(3);
    echo("<br>");
     
    //end
    echo("<hr> <br>");
     
    app.quit();
    }
    }

    Java Script example:

    //connect the object to control the emulator, if not already connected
    xhe_host = "127.0.0.1:7010";
    echo = require("../../../Templates JS/xweb_human_emulator.js");
     
    //Start
    echo("<hr> <font color = blue> mouse.send_mouse_move_to_flash_player </font> <hr>");
     
    //1 step
    echo("1.Go to the polygon:");
    echo(browser.navigate('http://humanemulator.net/poligon/embed.html') + " n");
    browser.sleep(3);
     
    //move the mouse to the flash player
    mouse.move(300,160,1,2);
     
    //step 2
    echo("2.Send click to flash at browser coordinate(play video):");
    echo(mouse.send_click_to_flash_player(300,160,0, false) + " n");
    browser.sleep(10);
     
    //step 3
    echo("3.Get coordinates relative to the flash player:");
    echo(mouse.get_mouse_pos_to_flash_player(0,300,160) + " n");
     
    //step 4
    echo("4.Send a left mouse button click event on the player coordinates:");
    echo(mouse.send_click_to_flash_player(290,150,0, true) + " n");
     
    //step 5
    echo("5.Get the coordinates relative to the flash player for the current cursor position(the cursor must be in the play area):");
    echo(mouse.get_mouse_pos_to_flash_player(0));
     
    //end
    echo("<hr> <br>");
     
    //Quit
    app.quit();