home page icon Flash Bestiary / Physics / Springy Titles

Springy Titles

This movie uses the SpringSim class I introduced in the movie Springy Thingies to animate a set of letters.

You may drag any of the letters with the mouse.

I've added some sliders and buttons on the bottom so you can see what affect changing gravity and the other constants has.

If you click the 'show guide' button, you may drag the anchor endpoints to change the title placement.

Typing a new title in the input box creates an amusing 'text editor on springs' effect as new letters are loaded and their springs are sproinged.

The default setting has upwards gravity, which simulates the effect of helium balloons. You can change the gravity slider (and other sliders) for different effects.

I've encapsulated the code into a ready-to-use class (SpringyLetters.as) which you can use to make your own springy titles without too much pain.

The code to set up a string of letters looks like this:

var gravK = -1; // affects gravity
var stiffK = .5; // affects stiffness
var frictionK = .1; // affects friction or viscosity
var springTautness = 0.8; // affects letter drape

// This sets up a string of colored letters
var sLetters = new SpringyLetters(this,
    gravK, // physics stuff, from above
    "KrazyDad", // the letters you want
    0, 200, // position of invisible anchor on left side
    stage.stageWidth); // width of title from anchor to anchor

UPDATE: The source code below now contains an Actionscript 3 version, in addition to the original Flash MX code.


sourcecode iconDownload the flash project
book iconJim's Favorite Actionscript Books
wiki iconAsk Jim about Actionscript
Next: Cretan Labyrinth

Having trouble opening the project? You may need to Upgrade to Flash CS3

Copyright © 2003,2008 by Jim Bumgardner. All Rights Reserved.        Leave Jim some feedback