The path animation sysbook is not loaded. Animations in the "Path Animation" sections will not run. Be sure that either mtb30.sbk or mtb30ani.sbk are included in your startupSysbooks.
Each object in ToolBook has a property called position that tells ToolBook where the object sits relative to the top and left edges of the page. Moving an object involves changing this property.
Position is a list of two numbers given in page units. In the illustration to the right, drag the object and notice how its position property changes.
pageUnitsPopup
buttonclick
buttonclick
"pageUnitsPopup"
strChecked
in,true
ThreeDeeRect
strChecked
strChecked
bottomLine
strChecked
topLine
strChecked
descr
strChecked
The position is 1258,973. he illustration above is 1560,1455. ag the object=
strChecked
n ~ J
strChecked
strChecked
client
strChecked
strChecked
strChecked
ToolBook - POSITION.TBKign
strChecked
strChecked
strChecked
strChecked
File Edit View Page Object Draw
strChecked
9733page
yline
client
endpoint
endpoint
value
Znewb
cb =
client
xpix =
sysPageUnitsPerPixel
ypix =
b =
w =
v1 = x - w
v2 =
cb +
v3 = v1+w
v4 = y -
fref =
sz =
fpos = v3 +
*2,v2+(v4-v2)
y2 -
v4 - v2
strChecked
strChecked
centerLine
strChecked
xline
client
endpoint
endpoint
value
Znewb
xpix =
sysPageUnitsPerPixel
ypix =
cb =
client
b =
h =
v1 =
cb +
v2 = y - h
v3 = x -
v4 = v2 + h
fref =
sz =
fpos = v1+(v3-v1)
y2 -
y2,v4 +
v3 - v1
strChecked
strChecked
centerLine
strChecked
strChecked
1258page
strChecked
strChecked
strChecked
false
false
Topics
strChecked
strChecked
out,true
ThreeDeeRect
strChecked
strChecked
bottomLine
strChecked
topLine
strChecked
out,true
ThreeDeeRect
strChecked
strChecked
bottomLine
strChecked
topLine
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
in,true
ThreeDeeRect
strChecked
strChecked
bottomLine
strChecked
topLine
strChecked
strChecked
strChecked
topicLabel
raisedField
tbk_wid_name
faceColor
highlightColor
shadowColor
tbk_wid_props
color,hls
color,hls
color,hls
tbk_wid_values
strChecked
highlight
strChecked
Fish tankation sysbook
shadow
strChecked
Fish tankation sysbook
strChecked
Fish tankation sysbook
Script recorder
label
myChapterID
visited
You can animate objects without writing scripts yourself by using the script recorder. This is useful when you want to animate one or more objects along an arbitrary path.
How to use the script recorder
When to use the script recorder
The animation to the right was created using the script recorder.
scriptRecorderPopup
buttonclick
buttonclick
"scriptRecorderPopup"
strChecked
strChecked
scriptRecorderPopup2
buttonclick
buttonclick
"scriptRecorderPopup2"
strChecked
strChecked
strChecked
strChecked
ThreeDeeRect
out,true
strChecked
strChecked
bottomLine
strChecked
topLine
strChecked
strChecked
ThreeDeeRect
in,true
strChecked
strChecked
bottomLine
strChecked
topLine
strChecked
balloonpath
strChecked
cloudpath
strChecked
cloud
strChecked
strChecked
strChecked
strChecked
ThreeDeeRect
out,false
strChecked
strChecked
bottomLine
strChecked
topLine
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
Animate
balloon
strChecked
&Button
false
false
3DD;3
Move command
label
myChapterID
visited
Moving an object involves setting its position property for each step of the animation. Usually this is accomplished in a loop structure, such as step or while.
The commands to use for moving an object are move to and move by.
Toolbook uses page units as the unit of measure to specify position.%
pageUnitsPopup
buttonclick
buttonclick
"pageUnitsPopup"
strChecked
strChecked
Move <object> to <position>
This command moves the specified object to the position supplied, for example:
move polygon "x" to 0,0
Moves it to the upper-left corner of the screen.een..
raisedField
tbk_wid_name
faceColor
highlightColor
shadowColor
tbk_wid_props
color,hls
color,hls
color,hls
tbk_wid_values
strChecked
highlight
strChecked
move toe Commandperty
shadow
strChecked
move toe Commandperty
* : J
strChecked
move toe Commandperty
raisedField
tbk_wid_name
faceColor
highlightColor
shadowColor
tbk_wid_props
color,hls
color,hls
color,hls
tbk_wid_values
strChecked
highlight
strChecked
move bye Commandperty
shadow
strChecked
move bye Commandperty
strChecked
move bye Commandperty
strChecked
Move <object> by <amount>
This command moves the object by the x and y amounts supplied, for example:
move polygon "x" by 45,60
Moves it 45 page units to the right and 60 down. s downits down
false
false
Move to command
label
myChapterID
visited
Use move to to move an object to a specific place. This is useful when the animated path of one object is relative to the positions of other objects.
The example at the right shows a moon orbiting a planet. The path that the moon follows is not an ellipse; it's a polygon with 50 vertices. The example script simply moves the moon object to each vertex of the polygon, one after the other.
out,true
ThreeDeeRect
strChecked
strChecked
bottomLine
strChecked
topLine
strChecked
in,true
ThreeDeeRect
strChecked
strChecked
bottomLine
strChecked
topLine
strChecked
orbit
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
out,false
ThreeDeeRect
strChecked
strChecked
bottomLine
strChecked
topLine
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
.animate
buttondown
orbit
moonRef
animate
-- sends the animate message
-- moves
along
-- optimization: store
{reference
%we will
-- be refering
moonRef =
sz =
-- we are going
walk
, so let's
-- cache them
vs =
"orbit"
come
a list
pairs
-- one
each vertex. For
iteration
loop,
-- we
grab
y positions
E, subtract half
ball's
positioning relative
that
(vs)
strChecked
Animate
false
false
Move by command
label
myChapterID
visited
Use the move by command when you want to move an object relative to its current position. For example, the command "move rectangle id 1 by 45,90" would move this object 45 page units to the right and 90 page units down.
This example uses move by in a loop to move the golf ball into the hole. The amount that the ball moves for each loop is calculated from the positions of the two objects. Note that the ball goes into the hole no matter where it starts from.
out,true
ThreeDeeRect
strChecked
strChecked
bottomLine
strChecked
topLine
strChecked
in,true
ThreeDeeRect
strChecked
strChecked
bottomLine
strChecked
topLine
strChecked
green
j z J
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
out,false
ThreeDeeRect
strChecked
strChecked
bottomLine
strChecked
topLine
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
Animate
false
false
Moving on idle
label
myChapterID
visited
Whenever ToolBook is not running scripts, it receives the idle message. If you want an animation to run constantly while nothing else is happening, trigger each step of the animation upon the idle message.
The advantage to animation driven by the idle message is that you can interrupt the animation at any time to interact with other parts of the application. The key is to handle only one "step" of the animation per execution of the idle handler.handler.
in,true
ThreeDeeRect
strChecked
ballbounds
strChecked
bottomLine
strChecked
topLine
strChecked
in,true
ThreeDeeRect
strChecked
strChecked
bottomLine
strChecked
topLine
strChecked
strChecked
The bouncing ball moves by a small amount upon each execution of the idle handler. Note that you can press any of the buttons on the tool bar or go to another application at any time.during this animation.
elapsedTime
curDir
vector
maxBounce
150,15,-1
myInfo
strChecked
false
false
tableOfContents
myChapter
myPages
chapterCount
topicCount
false
visited
24,27
selectChars
strChecked
tableOfContents
strChecked
60,Cats
68,Dogs
pageList
strChecked
chapter1
strChecked
pageID
Moving objectser
check1
strChecked
strChecked
chapter2
strChecked
pageID
Frame animation
check2
strChecked
strChecked
chapter3
Timing Animation 66
Simulating Gravity 67
topics
strChecked
pageID
Useful scriptsn
check3
strChecked
strChecked
chapter4
Chickens 26
Goats 25
topics
pageID
strChecked
Using path animation
check4
strChecked
strChecked
chapter5
strChecked
pageID
Untitled
check5
strChecked
strChecked
chapter6
strChecked
check6
strChecked
strChecked
chapter7
strChecked
check7
strChecked
strChecked
chapter8
strChecked
check8
strChecked
in,true
ThreeDeeRect
strChecked
strChecked
bottomLine
strChecked
topLine
strChecked
strChecked
This book shows you various techniques for animating objects, with and without writing handlers.
strChecked
minute
strChecked
counter
strChecked
enterpage
13,14,15
f@^@^@
How it works
label
myChapterID
visited
To create frame animation, you display a series of images quickly in sequence, each one slightly different than the one preceding it. The differences between the frames cause the object's apparent movement.
The animation at the top is a series of sixteen paint objects, shown individually below.
strChecked
out,true
ThreeDeeRect
strChecked
strChecked
bottomLine
strChecked
topLine
strChecked
strChecked
strChecked
out,true
ThreeDeeRect
strChecked
< L J
strChecked
bottomLine
strChecked
topLine
strChecked
strChecked
strChecked
strChecked
strChecked
curFrame
myCurFrame
myCurFrame
newFrame
hides
shows frames (paintobjects)
the globe animation.
-- The paintObjects are named "1"
notifybefore
numFrames = 16 --
curFrame = myCurFrame
-- currently showing
newFrame =
-- store
myCurFrame
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
*!:!J
strChecked
strChecked
strChecked
#0#J
strChecked
in,true
ThreeDeeRect
strChecked
f$v$J
strChecked
bottomLine
strChecked
P#b%n%
topLine
strChecked
widget slows down everything,
notifybefore
lastTime
strChecked
Slow-Mo
in,true
ThreeDeeRect
strChecked
,(<(J
strChecked
bottomLine
strChecked
'()4)
topLine
\)l)J
strChecked
strChecked
This globe animation is a series of paintObjects, shown one after the other.......the other.
curFrame
myCurFrame
mycurframe
highlight
newFrame
moves the
over
appropriate globe.
"globes are
numbered "1"
notifybefore
numFrames = 16 --
paintObjects
current
showing:
curFrame = mycurframe
newFrame =
myCurFrame
<-L-J
myCurFrame
strChecked
*f.l.
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
.6>6J
strChecked
D7T7J
strChecked
*,848
\8l8J
strChecked
*D9L9
strChecked
*\:d:
strChecked
*t;|;
strChecked
strChecked
strChecked
strChecked
highlight
strChecked
false
false
Hiding and showing
label
myChapterID
visited
A common method for creating frame animation is to hide and show objects in a group using the hide and show commands.
This animation hides and shows one paint object after another. Each paint object shows the dog in a different position. A user property of the group keeps track of which frame is currently shown.
out,true
ThreeDeeRect
strChecked
strChecked
bottomLine
strChecked
topLine
strChecked
curFrame
myCurFrame
myCurFrame
newFrame
-- This handler controls the animation
-- The
consists
18 paintobjects, named
-- 1
18, respectively. For each execution
(sent constantly
mode)
advanced one frame.
currently shown
stored
%a userProperty
notifybefore
numFrames = 18 --
paintObjects
ping
curFrame = myCurFrame
-- calculate
newFrame =
so we know what
h t (
curdog
lastTime
myCurFrame
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
in,true
ThreeDeeRect
strChecked
strChecked
bottomLine
h x J
strChecked
topLine
strChecked
strChecked
The running dog above is a series of 18 frames, shown one after the other. Small differences in the t at least 30 milliseconds have passed before displaying the next frame. This way, no more that 24 frames per second
false
false
4458q
xt414
wWsOO
86110
7ssp4
x?OHuOVS`1
_E7787
pMaeo
dd788
W6OO8
7885OOW
xsOOCh
VVS_p
oOO?x
OOcco
v6Wv7
sVV6x
s/OOg
86V8
6VVQc
oOO?ss
OOV?Fs
1!!/p
6VVOp
Animating buttons
label
myChapterID
false
visited
Buttons can display bitmap resources, which are stored in the book. In its normal state, a button displays the bitmap resource specified by its normalGraphic property. When you press the button, the button displays its invertGraphic. You can use these properties to create an animation effect.
The button on the right displays an animation when clicked.K
in,true
ThreeDeeRect
bottomLine
topLine
This button has two frames of animation: one specified by its normalGraphic, the other specified by its invertGraphic, which is displayed when clicked.
5bookref
,%H.%
,%H.%
false
5bookref
found
5bookref
notifyBefore
normalgraphic
k4 + 1
bitmap ("cd"&
bookref
notifyAfter
bref =
rl = resourceList("
found =
rl) = "cd"&i
C:\HOOK\CBT\NEWANIM.TBK
bookref
in,true
ThreeDeeRect
bottomLine
topLine
These buttons set their normalGraphic property to a series of images.lGraphic, the other specified by its invertGraphic.
arrow
5bookref
,%H.%
,%H.%
false
5bookref
found
5bookref
arrow
notifyBefore
normalgraphic
k6 + 1
bitmap ("arrow"&
bookref
notifyAfter
bref =
rl = resourceList("
found =
rl) = "
C:\HOOK\CBT\NEWANIM.TBK
bookref
false
Animating with color
label
myChapterID
false
visited
Not all animation involves moving or hiding objects. You can create an animation just by setting the colors of various objects.
The object representing the TV screen has a script that cycles its rgbFill property through 512 colors of the RGB spectrum.
Each panel of the colorful sculpture on the right cycles through four colors.
out,true
ThreeDeeRect
strChecked
strChecked
bottomLine
strChecked
topLine
strChecked
in,true
ThreeDeeRect
strChecked
strChecked
bottomLine
strChecked
topLine
& 6 J
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
curColor
fucurColor
gucurColor
notifybefore
Zcolorlist[4]
1]=128,128,0
2]=255,0,255
+3]=0,128,128
;=0,255,0
curColor =
k4 + 1
orgbfill
colorList[
curColor
strChecked
curColor
fucurColor
gucurColor
notifybefore
Zcolorlist[4]
1]=128,128,0
2]=255,0,255
+3]=0,128,128
;=0,255,0
curColor =
k4 + 1
orgbfill
colorList[
curColor
strChecked
curColor
fucurColor
gucurColor
-- cycles through four colors
notifybefore
Zcolorlist[4]
1]=128,128,0
2]=255,0,255
+3]=0,128,128
;=0,255,0
curColor =
k4 + 1
orgbfill
colorList[
curColor
strChecked
curColor
fucurColor
gucurColor
notifybefore
Zcolorlist[4]
1]=128,128,0
2]=255,0,255
+3]=0,128,128
;=0,255,0
curColor =
k4 + 1
orgbfill
colorList[
curColor
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
"0"J
strChecked
strChecked
#0#J
strChecked
strChecked
6$F$J
strChecked
strChecked
L%\%J
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
J)Z)J
strChecked
strChecked
>*N*J
strChecked
strChecked
2+B+J
strChecked
strChecked
.&, "
.&, "
oplastTime
timegettime
-- cycle through 512 colors
the rgb spectrum.
notifybefore
inc = 32 -- amount
each
orgbfill
r = (r+
g = (g+
b = (b+
lastTime
timegettime()
N/^/J
n/z/mp
strChecked
lastTime
strChecked
o P3&
strChecked
J1Z1J
strChecked
strChecked
strChecked
strChecked
strChecked
04@4J
strChecked
strChecked
b5r5J
strChecked
"626J
strChecked
strChecked
B7R7J
strChecked
strChecked
f8v8J
strChecked
&969J
strChecked
false
strChecked
&969J
strChecked
false
Simulating gravity
label
myChapterID
false
visited
This page has a useful handler for animating falling objects. You provide the handler with the object that you want to "drop," how tall that object is supposed to be, where the ground is, and the starting speed of the object.
Press the Animate button on the right to see a demonstration.{
out,true
ThreeDeeRect
strChecked
strChecked
bottomLine
strChecked
topLine
strChecked
in,true
ThreeDeeRect
strChecked
strChecked
bottomLine
strChecked
topLine
strChecked
ground
strChecked
V f J
strChecked
.animate
buttondown
animate message, handled
strChecked
out,false
ThreeDeeRect
strChecked
strChecked
bottomLine
strChecked
topLine
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
Animate
thought
strChecked
thought5
strChecked
thought4
strChecked
thought3
strChecked
thought2
strChecked
thought1
strChecked
ground
finaly
accelerate
animate
animate
finaly =
U"ground"
accelerate
,2,finalY
,1.5,
5625,684
origloc
strChecked
strChecked
strChecked
strChecked
false
131316=1
14;;?
1@@I;
6@@9@
= 10w
11;11
wq3Q91
wws ;
`5;30
`;053
1AV;1
V\VLVLV\
F\F\VLV\VE
eieieieie
ieieieieie
ieieieieie
ieieieieie
ieieie`
`ieieieie
ieieieieie
ieieieieie
ieieieieie
ieiei`0
PP!@
AVxP`
pwG?p
VTTVTVTP
991911
`ieieieie
ieieieieie
ieieieieie
iee 5
eieieieie
ieieieieie
ieieieie
v#n#n#
Timing animation
label
myChapterID
visited
When you want animation to move at a particular speed regardless of the machine it's on, you can write a handler to check the time during the animation process.
The function timeGetTime() in the mmsystem DLL file is useful for this purpose. This function returns the time in milliseconds. The mmsystem DLL comes with Windows 3.1.
out,true
ThreeDeeRect
strChecked
strChecked
bottomLine
strChecked
topLine
strChecked
in,true
ThreeDeeRect
strChecked
strChecked
bottomLine
strChecked
topLine
strChecked
strChecked
The animated globe above is a series of 16 frames. The buttons controlling its speed set a user property of the globe called Delay to various values (0 for "Fast," 60 for "medium," and 120 for "Slow"). The script in the globe checks to see if at least that many milliseconds have passed before displaying the next frame....
speedControl
strChecked
globe
delay
buttonclick
buttonclick
delay
"globe"
strChecked
Fa&st
globe
delay
buttonclick
buttonclick
delay
"globe"
strChecked
&Medium
globe
delay
buttonclick
buttonclick
delay
"globe"
strChecked
Slo&w
strChecked
globe
4478050,10,0
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
enterpage
false
false
xwwxxwwxx
wwxxwwxxww
xxwwxxwwxx
wwxxwwxxwp
xwwxxwwxx
wwxxwwxxww
xxwwxxwwxx
wwxxwwxxwp
Moving along a line
label
myChapterID
false
visited
Often, you just want to move an object along a straight line. This page contains a handler for doing that. You pass it the object you want to move, the line that you want to move the object along, and how many steps you want to take along the line.
Note that this handler will move an object along angled lines as well. Once you've positioned the guiding lines, you can hide them.
strChecked
PmoveObjectAlongPath
buttonclick
buttonclick
-- sends message handled
moveObjectAlongPath
m"path",15
strChecked
in,true
ThreeDeeRect
strChecked
strChecked
bottomLine
strChecked
topLine
strChecked
strChecked
Click each of the ellipses above to see them move along their respective paths.
PmoveObjectAlongPath
buttonclick
buttonclick
-- sends message handled
moveObjectAlongPath
"yoyo",40
strChecked
false
strChecked
out,true
ThreeDeeRect
strChecked
strChecked
bottomLine
strChecked
topLine
strChecked
out,true
ThreeDeeRect
strChecked
strChecked
bottomLine
strChecked
topLine
strChecked
topic
raisedField
tbk_wid_name
faceColor
highlightColor
shadowColor
tbk_wid_props
color,hls
color,hls
color,hls
tbk_wid_values
strChecked
highlight
strChecked
Table of contents
shadow
strChecked
Table of contents
strChecked
Table of contents
strChecked
Click on one of the topics below to view information on that subject.ubject.
Multimedia ToolBook comes with a sysbook that makes animations along paths easy to create and maintain. You can animate along straight or curved paths.
in,ms
ThreeDeeRect
bottomLine
topLine
in,ms
ThreeDeeRect
bottomLine
topLine
Here are two examples of the types of paths you can use.to animation.
(( (
w{'w(w{
false
false
Fish tank
label
myChapterID
visited
In this example, several fish are animated along different paths across the screen. The animations are set to loop continuously, so that the fish will endlessly complete the same cycle. The school of yellow fish was made by copying and pasting a single fish that was previously animated.
Each fish is a transparent bitmap with a white irregular polygon behind it as a mask.
in,ms
ThreeDeeRect
bottomLine
topLine
in,ms
ThreeDeeRect
bottomLine
topLine
placeholder
WjpositionChildViewer
<KinitAnimation
enterpage
endAnimation
leavepage
,%H.%
newbnds
positionChildViewer
serves
%the placeholder
train animation
-- on
opens
. On
sends
animate message
notifyAfter
"tank"
initAnimation
positionChildViewer
-- close
notifyBefore
endAnimation
isOpen
-- sizes
specified
r childViewer, bnds
newbnds= pageUnitsToClient(
strChecked
The aquatic scene below is actually taking place on another page in this book. A child viewer is displaying that page.
The rectangle behind the viewer has script to control its behavior.e rectangle behind it has script to control its behavior.
leavepage
enterpage
false
false
EKG monitor
label
myChapterID
visited
The path animation system book allows you to animate an object at either a constant or variable speed over the length of its path.
When a constant speed is chosen, the object moves over the length of its path at a steady rate. However, when a variable rate is chosen, the object moves quickly between distant points on its path and slowly between points that are near to one another.
illustrates an animation that is best done with a variable rate. The monitor's beam should move across the screen at a steady rate but up and down at varying rates.
anim_animationSettings
Start
MplayAnimation
variable
buttonUp
enterPage
playAnimation 1
"Beam"
notifyBefore
735,4545
startPosition
Start
ZstopAnimation
buttonUp
leavePage
stopAnimation
"Beam"
notifyBefore
Variable
MplayAnimation
buttonUp
playAnimation 1
"beam"
Variable Rate
Constant
MplayAnimation
buttonUp
playAnimation 2
"beam"
Constant Rate
in,ms
ThreeDeeRect
bottomLine
topLine
This example illustrates an animation that is best done with a variable rate. The monitor's beam should move across the screen at a steady rate but up and down at a faster rate..
The animation sysbook makes combining movement and frame animation easy. All you need to do is create a group of objects, specify a path, and then turn frame animation on.
in,ms
ThreeDeeRect
bottomLine
topLine
globe
MplayAnimation
animSysBookLoaded
enterpage
ZstopAnimation
animSysbookLoaded
leavePage
notifyBefore
animSysBookLoaded()
playAnimation 1
notifyAfter
animSysbookLoaded()
stopAnimation
curframe
anim_animationSettings
in,ms
ThreeDeeRect
bottomLine
topLine
Here we have our familiar animated earth with movement added.ded.
Each pixel on the screen is several page units wide by several units tall. The amount varies depending on your screen resolution. The sysPageUnitsPerPixel system property will tell you how many page units there are for each horizontal and vertical pixel represented on the screen. For example, in standard VGA, there are 15 page units per horizontal pixel and 15 per vertical pixel.
strChecked
scriptRecorderPopup1
visited
false
strChecked
scriptRecorderPopup1
strChecked
To use the script recorder:
1. Make sure the objects you want to move are not selected.
2. Choose Start Recording from the Edit menu.
3. Drag the objects along the path you want them to follow, clicking frequently to record the movement.
4. Choose Stop Recording from the Edit menu.
5. In the script of the button that starts the animation, choose Paste Recording from the script editor's Edit menu..
strChecked
scriptRecorderPopup2
visited
false
strChecked
strChecked
Guidelines for using the script recorder:
The main advantage of the script recorder is that you can create animation without writing scripts. However, there are also disadvantages:
Difficult to modify To change a recorded animation, you must either edit the script ToolBook created or record the animation again.
Difficult to create smooth movement It may be hard to create uniform spacing and direction between each step of the animation.
If you need to create smooth, easily modifiable animation, you may want to examine the topics in the Useful Scripts section of this book.......
strChecked
aboutAnimation
about
keychar
isOpen
focuswindow =
keyEnter
close
"about"
strChecked
in,false
ThreeDeeRect
strChecked
strChecked
bottomLine
strChecked
topLine
strChecked
strChecked
,%H.%
0,100,0
0,0,0
0,100,0
buttonclick
0,100,0
switch
tvOn
value
buttonclick
switch
(32)+32
(32)+32
--
(32)+32
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
out,true
ThreeDeeRect
strChecked
strChecked
bottomLine
strChecked
topLine
strChecked
false
about
screen
buttonclick
buttonclick
isOpen
"tv 1"
tvOn
T"screen"
close
"about"
strChecked
strChecked
strChecked
0"@"J
strChecked
strChecked
T#d#J
strChecked
strChecked
strChecked
strChecked
strChecked
,&<&J
strChecked
strChecked
L'\'J
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
B+R+J
strChecked
strChecked
childloc
l,|,J
strChecked
frame
strChecked
b-r-J
strChecked
lastTime
strChecked
strChecked
Animation Book
Created in
ToolBook 3.0
Asymetrix Corporation
strChecked
R0b0J
strChecked
strChecked
F1V1J
strChecked
strChecked
screen
>2J2mp
X2h2J
lastTime
strChecked
strChecked
strChecked
strChecked
strChecked
Written by
Joseph Brickkkin
ToolBook 3.0
Asymetrix Corporation
maxBounce
myInfo
-30,3,1
strChecked
-30,2,1
strChecked
strChecked
clock
childloc
strChecked
strChecked
screen
lastTime
strChecked
strChecked
strChecked
angle
strChecked
strChecked
strChecked
enterbackground
about
keychar
keyEnter
close
"about"
0,0,0
screen
screen =
tvOn
strChecked
strChecked
Animation Book
Created in
Multimedia
ToolBook 3.0
Asymetrix Corporation
screen
,%H.%
0,100,0
0,0,0
0,100,0
tvOn
value
lastTime
strChecked
strChecked
screen
66,67,68,23,78
curPat
itemoffset
patternlist
notifybefore
patternlist = "66,67,68,23,78"
curPat =
nextPat = itemoffset(
!,patternList)
lastTime
strChecked
tv switch
strChecked
screen
lastTime
strChecked
strChecked
strChecked
strChecked
strChecked
screen
lastTime
strChecked
placeholder
strChecked
enterpage
leavepage
credit
strChecked
Melody Christensen
credit
strChecked
Artwork byyyyyyy
train
scriptRecorderPopup1
toolbar
scriptRecorderPopup2
pageUnits
newChapterOrTopic
outlineOrganizer
aboutAnimation
tableOfContents
tv switch
Chapter Headings
Topics
toolbar
newpage
previous
first
strChecked
9501231240428864061321273852
9501231240428864061321273852
ASYM_TpID
myChapterID
myPages
Moving objects
label
Most animation involves moving an object from one place to another. The topics in this section discuss the various techniques for moving objects using OpenScript.
strChecked
placeholder
WjpositionChildViewer
train
<KinitAnimation
enterpage
train
leavepage
,%H.%
newbnds
positionChildViewer
.animate
train
serves
%the placeholder
train animation
-- on
opens
. On
sends
animate message
notifyAfter
initAnimation
positionChildViewer
-- close
notifyBefore
isOpen
-- sizes
specified
r childViewer, bnds
newbnds= pageUnitsToClient(
strChecked
strChecked
strChecked
leavepage
enterpage
7,6,11,4,3,12
ASYM_BeenHere
7,6,11,4,3,12
Frame animation
label
myChapterID
chapterCount
topicCount
myPages
A common method to display a complex animation is to create several frames and show them in a series, similar to the way a movie works. This section covers the basics of frame animation using OpenScript.
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
4 D J
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
strChecked
trailerCountdown
lastTime
myAngle
strChecked
strChecked
strChecked
strChecked
minute
strChecked
counter
strChecked
enterpage
13,14,15
13,14,15
Using path animation
label
myChapterID
myPages
The authoring system book (mtb30.sbk) offers a way to create complex animation without writing complex code.
To distribute an application with animationr more information...........................