|
Animating the box
Finally, the box is put into motion. Click the line of text that says "Orbit Box" to run the Orbit Box script. That script contains the following Lingo:
property pActive
on beginSprite(me)
pActive = FALSE
end beginSprite
on mouseUp(me)
tSprite = sprite(1)
tMember = tSprite.member
tMember.model("newBox").parent = tMember.model("newSphere")
pActive = TRUE
go next
end
on enterFrame(me)
if pActive then
tSprite = sprite(1)
tMember = tSprite.member
tMember.model("newBox").rotate(0,20, 25)
end if
end on
Here is what Orbit Box script does:
 |
When the mouse is clicked on the Orbit Box text, the box is made a child of the sphere. Because the sphere is rotating, this causes the box to begin orbiting at a fixed distance from the sphere. |
 |
The box itself is rotated at each enterFrame event. |
|