1
8
9 import com.sekati.core.App;
10 import com.sekati.effects.TextEffects;
11 import com.sekati.effects.AnimHandler;
12 import com.sekati.transitions.Mot;
13 import com.sekati.validate.TypeValidation;
14
15
18 class com.sekati.display.TextDisplay {
19
20
25 public static function clear(o:MovieClip):Void {
26 for(var i in o) {
27 if (TypeValidation.isTextField( o[i] )) o[i].htmlText = "";
28 }
29 }
30
31
36 public static function style(o:MovieClip):Void {
37 for(var i in o) {
38 if (TypeValidation.isTextField( o[i] ) && !o[i].styleSheet) o[i].styleSheet = App.css;
39 }
40 }
41
42
48 public static function show(tf:TextField, str:String):Void {
49 if (!tf.styleSheet) tf.styleSheet = App.css;
50 tf.htmlText = str;
51 }
52
53
60 public static function hide(o:Array, isAnim:Boolean):Void {
61 if (TypeValidation.isArray( o )) {
62 for(var i:Number = 0; i < o.length ; i++) {
63 if (TypeValidation.isTextField( o[i] )) {
64 o[i].stopTween( );
65 if (!isAnim) {
66 o[i]._alpha = 0;
67 o[i]._visible = false;
68 } else {
69 o[i].alphaTo( 0, 1, Mot.o.quint, 0.1 * i, function():Void {
70 o[i]._visible = false;
71 } );
72 }
73 }
74 }
75 }
76 }
77
78
85 public static function reveal(o:Array, isAnim:Boolean):Void {
86 if (TypeValidation.isArray( o )) {
87 for(var i:Number = 0; i < o.length ; i++) {
88 if (TypeValidation.isTextField( o[i] )) {
89 o[i].stopTween( );
90 if(!isAnim) {
91 o[i]._alpha = 100;
92 o[i]._visible = true;
93 } else {
94 o[i]._visible = true;
95 o[i].alphaTo( 100, 0.3, Mot.o.quint, 0.1 * i );
96 }
97 }
98 }
99 }
100 }
101
102
109 public static function anim(tf:TextField, str:String, cb:Function):Void {
110 if (!tf.styleSheet) tf.styleSheet = App.css;
111 TextEffects.atype( tf, str, cb );
112
113 }
114
115
123 public static function push(tf:TextField, str:String, ms:Number, cb:Function):Void {
124 if (!tf.styleSheet) tf.styleSheet = App.css;
125 var t:Number = (!ms) ? 10 : ms;
126 TextEffects.pushtype( tf, str, t, true, cb );
127 }
128
129
134 public static function stopEffect(tf:TextField):Void {
135 AnimHandler.destroy( tf );
136 }
137
138 private function TextDisplay() {
139 }
140 }