home *** CD-ROM | disk | FTP | other *** search
/ Chip 2000 May / Chip_2000-05_cd1.bin / zkuste / Perl / ActivePerl-5.6.0.613.msi / 䆊䌷䈹䈙䏵-䞅䞆䞀㡆䞃䄦䠥 / _56eeca5b36d5bbe2d453753de57e0ccc < prev    next >
Text File  |  2000-03-15  |  2KB  |  67 lines

  1. <HTML>
  2.  
  3. <HEAD><TITLE>PerlScript sample:  Mouse tracking</TITLE></HEAD>
  4.                       
  5. <!-- 
  6.     ActiveState PerlScript sample 
  7.     PerlScript:  The easiest, most powerful way to program custom web solutions. 
  8. -->
  9.  
  10. <BODY BGCOLOR="#FFFFFF" TOPMARGIN=8>
  11. <FORM method="POST" NAME="MyForm1">
  12. <TABLE CELLPADDING=0 BORDER=3 CELLSPACING=0>
  13. <TR VALIGN=TOP ><TD>
  14. <A HREF="index.htm" NAME="Image"><IMG SRC="PSBWlogo.gif" WIDTH=400 HEIGHT=48 ALT="The power of PerlScript!" BORDER=5></A><P>
  15. </TD></TR>
  16. <TR VALIGN=MIDDLE><TD VALIGN=MIDDLE ALIGN=CENTER><FONT SIZE=5>
  17. <INPUT TYPE="text" NAME="TxtLinkDescription" SIZE=50></FONT>
  18. </TD></TR>
  19. </TABLE>
  20. </FORM>
  21. <HR>
  22.  
  23. <P>
  24. <FONT  SIZE=5>
  25. <P> Move your mouse over the PerlScript logo to see Image_MouseMove event parameters. 
  26. </FONT>
  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. <TABLE BORDER=0 CELLPADDING=3 CELLSPACING=0 width=600>
  53. <TR VALIGN=TOP>
  54.     <TD ALIGN=RIGHT>
  55.     <FONT FACE="Arial, Helvetica" SIZE="1">
  56.     <B>Best experienced with<BR> 
  57.     <A HREF="http://www.microsoft.com/ie/" TARGET="_top">
  58.     <img src="ie_animated.gif" width="88" height="31" border="0" alt="Microsoft Internet Explorer" vspace="5"></a>
  59.     <BR>Click here to start.</B>
  60.     </FONT></TD>
  61. </TR>
  62. </TABLE>
  63.  
  64. </BODY>
  65. </HTML>
  66.  
  67.