/textanim

The TextAnim is an open source code for dynamic text animation in Flash - ActionScript 3

Primary LanguageActionScript

TEXTANIM AS3

The TextAnim is an open source code for dynamic text animation in Flash - ActionScript 3, it's events based and tween engine independent.

How does it work?

The library has no ready-made animation, the idea is only break apart the TextField (split TextField) and dispatch blocks sequence, to be free to make the animation you want. Doesn't matter which tween engine that you like: Tweener, BTween, GTween, Tweensy or any other.

Just don't forget to embed the font that you want to use.

Example 1:

	import flupie.textanim.*;
	import caurina.transitions.*;

	var myTextAnim:TextAnim = new TextAnim(myTextField);
	myTextAnim.effects = myEffect;
	myTextAnim.blocksVisible = false;
	myTextAnim.start();

	function myEffect(block:TextAnimBlock):void
	{
	    block.alpha = 0;
	    Tweener.addTween(block, {alpha:1, time:.5});
	}

Example 2:

	TextAnim.create(myTextField, {effects:myEffect, split:TextAnimSplit.WORDS}).start();

Example 3:

	var myTextAnim:TextAnim = new TextAnim(myTextField);
	myTextAnim.effects = myEffect;
	myTextAnim.mode = TextAnimMode.LAST_FIRST;

	myTextAnim.addEventListener(TextAnimEvent.START, onStartHandler);
	myTextAnim.start();

split

To specify how the TextAnim will break the text. TextAnimSplit:

  • CHARS
  • WORDS
  • LINES

mode

Is the way of the effects dispatches will be occurs. TextAnim dispatch effects in five diferent ways. TextAnimMode:

  • FIRST_LAST
  • LAST_FIRST
  • EDGES_CENTER
  • CENTER_EDGES
  • RANDOM

Tools

Extra tools for special treatment of TextAnim instance. Can convert the blocks to bitmap, apply patterns, etc. Are static functions to implement some useful things. Get more here TextAnimTools.

  • getColorBounds
  • setGradientLinear
  • setPattern
  • showAnchors
  • toBitmap
  • toVector

More

You can download the latest stable version of TextAnim, check out Flupie blog to get a few examples with source, read the documentation or get TextAnim code generator, called TextAnim Maker.

All examples was made with the IDE Flash CS4, but everything has been properly tested in other environments, Flex, Flash Builder, mxmlc command line, FDT.