textanim example
/**
* Copyright mash ( http://wonderfl.net/user/mash )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/7cxt
*/
package {
import flash.display.Sprite;
import flash.events.Event;
import flash.text.TextField;
import flash.text.TextFormat;
import flupie.textanim.*;
import caurina.transitions.Tweener;
import net.wonderfl.utils.FontLoader;
public class FlashTest extends Sprite
{
public function FlashTest() {
var fl :FontLoader = new FontLoader;
fl.load( "Bebas" );
fl.addEventListener( Event.COMPLETE, function(ev :Event) :void {
var tf :TextField = new TextField;
tf.embedFonts = true;
tf.defaultTextFormat = new TextFormat( "Bebas", 42, 0xFFCC00);
tf.text = "bbbbbbbbbbbbbbbbbb";
addChild(tf);
var anim :TextAnim = new TextAnim(tf);
anim.effects = myEffect;
anim.blocksVisible = false;
anim.start();
});
}
private function myEffect(block:TextAnimBlock):void {
block.scaleX = block.scaleY = 0;
block.rotation = -120;
Tweener.addTween(block, {rotation:0, scaleX:1, scaleY:1, time:2, transition:"easeoutelastic"});
}
}
}