home *** CD-ROM | disk | FTP | other *** search
/ Netrunner 2004 October / NETRUNNER0410.ISO / regular / ActivePerl-5.8.4.810-MSWin32-x86.msi / _c0a326a2afe70f29657a53f05b3d8ee0 < prev    next >
Encoding:
Text File  |  2004-06-01  |  1.3 KB  |  53 lines

  1. <HTML>
  2.  
  3. <HEAD><TITLE>PerlScript sample:  Mouse tracking</TITLE>
  4. <link rel="stylesheet" type="text/css" href="../HTML/Active.css">
  5. </HEAD>
  6.                       
  7. <!-- 
  8.     ActiveState PerlScript sample 
  9.     PerlScript:  The easiest, most powerful way to program custom web solutions. 
  10. -->
  11.  
  12. <BODY>
  13. <TABLE CELLPADDING=0 BORDER=3 CELLSPACING=0>
  14. <TR VALIGN=TOP ><TD>
  15. <A HREF="index.htm" NAME="Image"><IMG SRC="PSBWlogo.gif" WIDTH=400 HEIGHT=48 ALT="The power of PerlScript!" BORDER=5></A><P>
  16. </TD></TR>
  17. <FORM method="POST" NAME="MyForm1">
  18. <TR VALIGN=MIDDLE><TD VALIGN=MIDDLE ALIGN=CENTER>
  19. <INPUT TYPE="text" NAME="TxtLinkDescription" SIZE=50>
  20. </TD></TR>
  21. </TABLE>
  22. </FORM>
  23. <HR>
  24.  
  25. <P>
  26.  <P> Move your mouse over the PerlScript logo to see Image_MouseMove event parameters.
  27.  
  28.  
  29. <SCRIPT language="PerlScript">
  30. sub Image_MouseMove {
  31.     my ($x,$y, $s, $b) = @_;
  32.     $window->document->MyForm1->TxtLinkDescription->{'Value'} = "MouseMove s:$s b:$b x:$x y:$y";
  33. }
  34.  
  35. sub Image_mousemove {
  36.     Image_MouseMove(@_);
  37. }
  38.  
  39. sub Image_onmousemove {
  40.     my $e = $window->event;
  41.     my ($x,$y, $s, $b) = ($e->X, $e->Y, $e->OffsetX, $e->OffsetY);
  42.     $window->document->MyForm1->TxtLinkDescription->{'Value'}
  43.         = "MouseMove [X=$x Y=$y relX=$s relY=$b]";
  44. }
  45.   </SCRIPT>
  46. <P>
  47.  
  48.  
  49. <!-- Horizontal line -->
  50. <HR>
  51.  
  52. </BODY>
  53. </HTML>