1
8
9 import com.sekati.display.UIClip;
10 import com.sekati.utils.Delegate;
11 import com.sekati.transitions.Mot;
12 import caurina.transitions.Tweener;
13
14
17 class com.sekati.ui.AbstractBtn extends UIClip {
18
19 private static var FADE:Number = 60;
20 private var _tf:TextField;
21
22 public function AbstractBtn() {
23 super();
24 _tf = _this.tf;
25 _tf.autoSize = true;
26 _tf._alpha = FADE;
27
28 _this.onRollOver = _this.onDragOver = Delegate.create(_this, _onRollOver);
29 _this.onRollOut = _this.onDragOut = Delegate.create(_this, _onRollOut);
30 _this.onPress = Delegate.create(_this, _onPress);
31 }
32
33
34
35 private function _onRollOver():Void {
36 Tweener.removeTweens(_tf, "_alpha");
37 Tweener.addTween(_tf, {base:Mot.abase, _alpha:100});
38 }
39
40 private function _onRollOut():Void {
41 Tweener.removeTweens(_tf, "_alpha");
42 Tweener.addTween(_tf, {base:Mot.abaseLong, _alpha:FADE});
43 }
44
45 private function _onPress():Void {
46 tween(_tf, {base:Mot.abase, _alpha:FADE});
47 }
48
49 }
50