A Flash Developer Resource Site

Results 1 to 9 of 9

Thread: [RESOLVED] Smooth Button Animation - onRelease??

Threaded View

  1. #1
    Member
    Join Date
    Jul 2008
    Posts
    73

    resolved [RESOLVED] Smooth Button Animation - onRelease??

    I've been following the tutorial "Creating Smooth Button Animation in Flash": http://www.republicofcode.com/tutori...ttonanimation/

    As with most menus, when the button is selected it needs to stay highlighted so the user knows which section they are in. The tutorial left this bit out.

    I've been unsuccessful so far. Can anyone help finish it?

    Code:
    import mx.transitions.Tween;
    import mx.transitions.easing.*;
    
    for (i=1; i<=4; i++) {
    	var current_btn = this["my"+i+"_btn"];
    
    	current_btn.onRollOver = function() {
    		var currentAlpha = this.cover_mc._alpha;
    		var myHoriTween:Tween = new Tween(this.cover_mc, "_alpha", Strong.easeOut, currentAlpha, 0, 0.5, true);
    	};
    
    	current_btn.onRollOut = function() {
    		var currentAlpha = this.cover_mc._alpha;
    		var myHoriTween:Tween = new Tween(this.cover_mc, "_alpha", Regular.easeIn, currentAlpha, 100, 0.5, true); 
    	};
    
    	current_btn.onRelease = function() {
    		//code here
    	};
    }
    I've attached the .fla
    Attached Files Attached Files
    Last edited by Playdoe; 01-20-2010 at 09:19 AM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center