Lingo 4.1: In Situ Animation

READING: Chapter 2 in D8D (The Elements of Animation)

File "DancingArthur.dir"

Shows how animation can be performed in a single frame (marker "fastdance") by rotating between cast members appearing in the channel.

on mouseUp
repeat with counter = 2 to 150
sampleImage = (counter mod 8) + 3 -- chooses between 3 and 10
put sampleImage
sprite(2).member = sampleImage
updateStage
end repeat
end


Guess what the command sprite(2).member does.

Why does the sampleImage rotate between 3 and 10?

Watch the animation carefully - do you really see 150 images of Arthur?
(Remember, Director will do its best to display the animation, but will try very hard to keep up with the timing requirements. If it cannot, it will ignore the animation. Timing uber alles!)

Play the file under the marker "slowerdance"
How does it work?
Observe that the core of the script is the same as above, but there is no repeat command. The exitFrame script provides the timing. Now you can control the animation speed using the Tempo channel.

Both animations use a counter. Is this the very same counter? Why not?

When is a global variable initialized? When you start a movie or every time you re-start a movie?

Note that you can make the animations more funny if you randomize the outcome of the mod calculation before assigning it to sampleImage

Also notice that you can make Arthur double-dance!


 

 

Maintained By: Takis Metaxas
Last Modified: March 13, 2008