HTML and CSS Reference
In-Depth Information
Function
Invoked By / Called By
Calls
change
Invoked by action of the
setInterval
function
called in
finish
drawall
, calls the
moveit
method of
cball
, which is
moveball.
Invoked directly by code in a
var
statement
Ball
Myrectangle
Invoked directly by code in a
var
statement
drawball
Invoked by call of the
draw
method for the one
Ball
object
drawrects
Invoked by call of the
draw
method for the
target
object
moveball
Invoked by call of the
moveit
method for the
one
Ball
object
Picture
Invoked directly by code in
var
statements
Invoked by call of the
draw
method for a
picture
object
drawAnImage
Sling
Invoked directly by code in
var
statements
drawsling
Invoked by call of the
draw
method for
mysling
Table 4-6 shows the code for the slingshot application, with the new or changed lines commented. Notice
that the form is absent from the
body
element. Before looking at the code, try to identify what parts will be
the same as in the cannonball application and what would be different.
Table 4-6.
The Slingshot Application
Code
Explanation
<html>
<head>
<title>Slingshot pulling back</title>
<script type="text/javascript">
var cwidth = 1200;