/** * com.joy.ui.assets.AbstractBtn * @version 1.0.5 * @author jason m horwitz | sekati.com | tendercreative.com * Copyright (C) 2007 jason m horwitz, Sekat LLC. All Rights Reserved. * Released under the MIT License: http://www.opensource.org/licenses/mit-license.php */ import com.sekati.display.UIClip; import com.sekati.utils.Delegate; import com.sekati.transitions.Mot; import caurina.transitions.Tweener; /** * AbstractBtn */ class com.sekati.ui.AbstractBtn extends UIClip { private static var FADE:Number = 60; private var _tf:TextField; public function AbstractBtn() { super(); _tf = _this.tf; _tf.autoSize = true; _tf._alpha = FADE; // events _this.onRollOver = _this.onDragOver = Delegate.create(_this, _onRollOver); _this.onRollOut = _this.onDragOut = Delegate.create(_this, _onRollOut); _this.onPress = Delegate.create(_this, _onPress); } // UI EVENTS private function _onRollOver():Void { Tweener.removeTweens(_tf, "_alpha"); Tweener.addTween(_tf, {base:Mot.abase, _alpha:100}); } private function _onRollOut():Void { Tweener.removeTweens(_tf, "_alpha"); Tweener.addTween(_tf, {base:Mot.abaseLong, _alpha:FADE}); } private function _onPress():Void { tween(_tf, {base:Mot.abase, _alpha:FADE}); } }