Text animation sequence
Posted: June 11th, 2010 | Author: guindexA long time ago I want to talk about it, but for many things became impossible, so finally let’s talk about something very usefull to do with TextAnim. In the begining, when TextAnim became public we receive some question about how is possible to create sequences of text animation, and can TextAnim provide support for it?
So, that’s a good question, in the begining the class had a lot of extra thing, for effects, tween, alignment, text formating and many others, and one day we decide remove all that things and make TextAnim clear, with only one feature: “break apart the TextField” this is something really hard to do when you have a lot of code, so that’s reason to TextAnim has nothing for that, and even then we can’t scape of create a Tools class (TextAnimTool), naturaly all the other things that TextAnim has today are to make it to the best way.
Sequences are something really great, but looking closer, it’s out of original scope. We recommend that you make all your particular things manualy, because the class was design for things like that and it’s really simple. Special thanks to Lucas Motta that was the most faster guy, he sent a usefull class to do sequences at the first week, check out it here.
When we think about sequences, or crazy similar things, we have to consider a lot of things more then change text on a interval, change the text format size/font/color/align, play sounds, change time/interval/delay images, filters and so on, anything.
Here is one other example of sequence, with other rules, that’s nothing new but can be usefull too:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | //... public class TASequence extends Sprite { public var _sequence:Array; public var _i:int = 0; public var _tf:TextField; public var _fm:TextFormat; public var _ta:TextAnim; public function TASequence() { _fm = new TextFormat("myFontName", 32, 0xFF0000); _tf = new TextField(); _tf.autoSize = "left"; _tf.embedFonts = true; _tf.defaultTextFormat = _fm; addChild(_tf); _ta = new TextAnim(_tf); _sequence = [ {htmlText:"My text 1", interval:50, effects:my1Effect, next:5}, {htmlText:"FOR <font color=\"#d6156c\">DYNAMIC TEXT</font> ANIMATION", interval:50, effects:my2Effect, next:6}, {htmlText:"My other text 3", interval:30, mode:"random", effects:my3Effect, next:6} ]; playNext(); } public function playNext():void { _ta.effects = _sequence[_i].effects; _ta.interval = _sequence[_i].interval; _ta.htmlText = _sequence[_i].htmlText; _ta.blocksVisible = false; _ta.start(); if (_i < _sequence.length-1) setTimeout(playNext, _sequence[_i].next * 1000); _i ++; } } //... |
Download source
- TextAnim text sequence animation example: textanim_sequence.zip
- TextAnim latest version: downloads list
Filed under: TextAnim | Tags: actionscript, animation, as3, banner, flash, intro, motion, sequence, textfield, tweener | 10 Comments »

Muito útil pra todo mundo isso! Feras demais!
TextAnim é muito amor, magia, sedução.
Obrigado por essa pérola. Eu sou fan, entusiasta e evangelista de TextAnim.
Long live and prosper!
Hi,
i using textanim for a week and i really love it. But i got a little problem. I making a sequence basically like in your example. But it is a looping sequence. And after some time the textanimations really start to slow down. Is it necessery to create the whole textAnim Object new after i finished a loop?
Hi case23,
Well, not exactly. You can create a new object TextAnim each loop, just remove the previous instance. But it is not necessary, you can always use the same instance and reset the array index for each loop.
Thanks for the fast answer!
After testing around i realy have the feeling this happens only with the Flashplayer 10, and on a PC. On a Mac i don´t have a problem at all. Also, is it normal that with Flashplayer 9, I cannot center the Anchors of the single BLocks, or do i something wrong?
That’s a good question. Yes you can, TextAnim has a singly linked list of blocks, so if you need to get a single block, or a group of block, you have two ways:
Example 1:
if (block.index < 4) block.updateRegistration(15, 10);
});
Example 2:
and look, if you want to get a block manually, you can go like that:
I hope that’s can help you. I know that’s not the best way but if not work like you want, just create a diferent instance of TextAnim.
Thanks again for your help.
I just share what i found out where my mistake was. Maybe someone has the same and find the answer here. I used
“textField.antiAliasType = AntiAliasType.ADVANCED;”
on my textfield, and it seams that this was the problem that the Anchors were on the upper left corner when i opened the swf with FlashPlayer 9. Also the slowing down of the Animation only happens when i open the swf, with FlashPayer10 Debug Standalone on a PC. If i put the swf in a website and open it with, as example firefox or everywhere else, everything works fine.
So thanks again for this beautiful Library which realy make doing my textanimation stuff much easier.
Hi, i’m using flupie but i’ve found a little problem. In most cases block of text (letters) are cut off. Especially in lower cases y, j, p. In Upper case is OK. The same thing is happend when using some glows and shadows.
Is there any chance to avoid this?
Thanks
P
Hi Peter_D,
Yes, that’s true. Some Fonts has kerning diferent and for some reason the TextField can’t handle with that (I really don’t know what happens exactly). So you can try set a height for your TextField before create your TextAnim instance, or autoSize and multiline. But the thing is, we actualy working on the a new version of flupie TextAnim package and we’ll try find out one fix for that.
thanks.
Les dejo una especie de “onComplete”, sólo se comprueba que el bloque sea el último:
public function fx(block:TextAnimBlock):void
{
TweenMax.to(block, 1, { alpha:0 , onComplete:function() {
if (block.nextBlock == null) {
trace(“complete!”)
}
}});
}