1  /**
     2   * com.joy.ui.assets.AbstractBtn
     3   * @version 1.0.5
     4   * @author jason m horwitz | sekati.com | tendercreative.com
     5   * Copyright (C) 2007  jason m horwitz, Sekat LLC. All Rights Reserved.
     6   * Released under the MIT License: http://www.opensource.org/licenses/mit-license.php
     7   */
     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  /**
    15   * AbstractBtn
    16   */
    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  		// events
    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  	// UI EVENTS
    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