A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: smooth transition with tweenlite doesn't work

  1. #1
    Member
    Join Date
    Jun 2011
    Posts
    85

    Question smooth transition with tweenlite doesn't work

    Hello,

    I have a vector circle and what to do the following:

    I 'd like to animate it with tweenlite so it looks like a shockwave of an explosion. At first it fades in (from 0 to .5) and gets scaled and when it reaches half of the total animation time it fades out but it still gets scaled (hope you know what I mean).

    Currently it looks horrible because I don't know how to get a smooth transition from part 1 to part 2 with TweenLite. My animation stops when reaching the end of part 1 and suddenly makes a jump to part 2.

    Can someone help me out with this problem please? Thank you very much.

    Total time of animation: .75 sec
    total amount of scaling: 5


    Code:
    part 1 of 2:
    
    TweenLite.to(blastwave, .375, {alpha:.5, transformAroundCenter:{scale:2.23},
    				onComplete:blastScaleFadeOut, onCompleteParams:[blastwave]});
    
    
    part 2 of 2:
    
    private function blastScaleFadeOut(object:DisplayObject, time:Number = .375, scaleVal:Number = 4.46) {
    			
    	TweenLite.to(object, time, {alpha:0, transformAroundCenter:{scale:scaleVal},
    		onComplete:backgroundSprite.removeChild, onCompleteParams:[object]});
    			
    }

  2. #2
    Will moderate for beer
    Join Date
    Apr 2007
    Location
    Austin, TX
    Posts
    6,801
    Instead of doing two Tweens which occur sequentially and handle both fade and scale, do three. One will do just the scale, that should be the whole time. The other two will be half duration and sequential, and handle the alpha.

    So basically, remove the scale from the ones you have, and do it separately and kicked off at the same time as the first one.

  3. #3

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