forked from: forked from: Tweener + TextShortcuts
forked from forked from: Tweener + TextShortcuts (diff: 2)
Tweener + TextShortcuts
ActionScript3 source code
/**
* Copyright s8t1h12akj ( http://wonderfl.net/user/s8t1h12akj )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/2Ifw
*/
// forked from s8t1h12akj's forked from: Tweener + TextShortcuts
// forked from ProjectNya's Tweener + TextShortcuts
////////////////////////////////////////////////////////////////////////////////
// Tweener + TextShortcuts
////////////////////////////////////////////////////////////////////////////////
package {
import flash.display.Sprite;
import flash.text.TextField;
import flash.text.TextFieldType;
import flash.text.AntiAliasType;
import flash.text.TextFormat;
import flash.text.TextFormatAlign;
import flash.utils.Timer;
import flash.events.TimerEvent;
import flash.filters.DropShadowFilter;
import caurina.transitions.Tweener;
import caurina.transitions.properties.TextShortcuts;
[SWF(backgroundColor="#000000", width="465", height="465", frameRate="30")]
public class Main extends Sprite {
private var txt:TextField;
public function Main() {
//Wonderfl.capture_delay(2);
init();
}
private function init():void {
TextShortcuts.init();
var tf:TextFormat = new TextFormat();
tf.font = "_ゴシック";
tf.size = 24;
tf.align = TextFormatAlign.CENTER;
txt = new TextField();
addChild(txt);
txt.x = 30;
txt.y = 190;
txt.width = 425;
txt.height = 85;
txt.type = TextFieldType.DYNAMIC;
txt.selectable = false;
//txt.embedFonts = true;
//txt.antiAliasType = AntiAliasType.ADVANCED;
txt.defaultTextFormat = tf;
txt.textColor = 0xFFFFFF;
txt.filters = [new DropShadowFilter(2, 90, 0x000000, 0.4, 8, 8, 2, 3, false, false, false)];
//
txt.text = "";
start();
}
private function start():void {
Tweener.addTween(txt, {_text: "qponシステム水面の波紋作成楽しいですね", time: 3, transition: "linear", onComplete: complete});
}
private function complete():void {
var timer:Timer = new Timer(500, 1);
timer.addEventListener(TimerEvent.TIMER_COMPLETE, wait, false, 0, true);
timer.start();
}
private function wait(evt:TimerEvent):void {
evt.target.removeEventListener(TimerEvent.TIMER_COMPLETE, wait);
start();
}
}
}