In the spirit of the Expressions Lab, here are a series of mostly unrelated topics, each showcasing an interesting and hopefully useful idea or technique. Unlike the Expressions Lab, you will find a more detailed analysis of the code here.

The code itself appears twice. The first version is for your convenient copy-and-paste use. You should be able to drop these expressions right into your own AE projects. The second version is annotated with my comments to help you understand how the code works.

You’ll notice that in the analysis section of each topic, the code itself is color coded. Bright blue is used to identify the JavaScript keywords. The lighter blue identifies the After Effects-specific extensions to the language. The purple is used to highlight variable names, numbers, and text - basically anything that is defined by the expression writer. JavaScript operators and essential punctuation are shown in black. My comments are in red. I hope you enjoy your visit. If you find errors or have questions, comments or suggestions for new topics, please contact me. Happy expressioneering!

basic audio animation
triggering an expression with audio
audio beat counter
universal up down clock
universal counter
random binary block
looping wiggle
wiggle one dimension only
three D corner pin
layer invisible when facing away from camera
auto focus
elastic connection
proximity detection
collision detection
light falloff
inverse kinematics redux
trigger animation with markers
sample color data from image
obscuration using sampleImage
display source name of current layer
auto orient y only