Example TextAnim with texture

Posted: February 4th, 2010 | Author: guindex

Hey!

Get Adobe Flash player

Basically I created an instance of TextAnim with an initial effect and a pattern (you can apply some TextAnimTool useful tools). That receives the URL parameter with text. Then put some delays that simply change the property and start the animation again.

This is a quick example of use of TextAnim to demonstrate the basic operation of the Class. Sure, you can ready a bit more on documentation.


Create Bitmap and getting text by the parameters on loaderInfo

1
2
var pattern:Bitmap = new Bitmap(new MyBitmapData(0,0));
myTextField.text = loaderInfo.parameters.text;

Create TextAnim

1
2
3
4
5
6
7
8
import flupie.textanim.*;

var anim:TextAnim = new TextAnim(myTextField);
TextAnimTools.setPattern(anim, pattern);
anim.effects = myEffect;
anim.blocksVisible = false;

anim.start();

IMPORTANT! Don’t forget to embed the font that you want to use.

NOTE: The most important thing to note myEffect is a function, this function is called for each block of text, and must receive a TextAnimBlock as parameter, then create effect using the tween engine that you prefer (Tweener, BTween, GTween, Tweensy, TweenMax…)

Effect function

1
2
3
4
5
6
7
8
//create your animation effect...

function myEffect(block:TextAnimBlock):void {
  block.alpha = 0;
  block.x = block.posX - 40;
  block.scaleX = block.scaleY = 3;
  Tweener.addTween(block, {alpha:1, x:block.posX, _scale:1, time:.5});
}

DOWNLOAD

1 – Take an example like: textanim_pattern.zip
2 – You need to download the last version of TextAnim: TextAnim download list
3 – Do not forget to download your favorite tween engine separate. For this example I used Tweener

Filed under: TextAnim | Tags: , , , , | 5 Comments »