TweenMax – Tweening a timeline (Advanced Tweening)

Friday, December 18th, 2009 | ActionScript 3, examples

It’s been a really busy week doing a lot of interactive motion work, so no time to work on my Theme Designer, but here’s a little trick I picked up this past week from Jack. Tweening a timeline allows you to create multiple tweens and then apply one ease to the whole group. Neat trick, eh?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
package  
{
    import com.greensock.TimelineMax;
    import com.greensock.TweenMax;
    import com.greensock.easing.Linear;
    import com.greensock.easing.Quart;
 
    import flash.display.Sprite;
 
    /**
     * @author John Lindquist
     */
    [SWF(width="900", height="480", frameRate="31")]
    public class EasingATimeline extends Sprite 
    {
        private var square:Sprite;
        private static const STEP_DURATION:Number = 1;
 
        public function EasingATimeline()
        {
            square = new Sprite();	
            square.graphics.beginFill(0xcc0000);
            square.graphics.drawRect(0, 0, 50, 50);
            square.graphics.endFill();
 
            square.x = 100;
            square.y = 50;
 
            addChild(square);
 
            //set all the eases of your steps to Linear.easeNone
            var step1:TweenMax = TweenMax.to(square, STEP_DURATION, {x: 700, y: 50, ease: Linear.easeNone});
            var step2:TweenMax = TweenMax.to(square, STEP_DURATION, {x: 700, y: 350, ease: Linear.easeNone});
            var step3:TweenMax = TweenMax.to(square, STEP_DURATION, {x: 100, y: 350, ease: Linear.easeNone});
            var step4:TweenMax = TweenMax.to(square, STEP_DURATION, {x: 100, y: 50, ease: Linear.easeNone});
 
            var timeline:TimelineMax = new TimelineMax();
            timeline.append(step1);
            timeline.append(step2);
            timeline.append(step3);
            timeline.append(step4);
            //pause your timeline
            timeline.pause();
 
            //tween your timeline with whatever ease you want
            TweenMax.to(timeline, timeline.totalDuration, {currentTime: timeline.totalDuration, ease: Quart.easeInOut, repeat: -1});
        }
    }
}

Tags:

  • Above the code is very helpful to improve my coding knowledge.
  • Superb tutorial you have sharad here and i get it huge information.
  • Wow, great article, I really appreciate your thought process and having it explained properly, thank you!
  • umair malik
    Wow!!! Its an amazing coding... I really like these codes...    Property Preservation  |  Property Preservation Companies
  • thanks for sharing, I liked the article and a lot of things I get from the discussion of thisarticle.
  • bucket swing seats
    Resources like the one you mentioned here will be very useful to me! I will post a link to this page on my blog. I am sure my visitors will find that very useful.
  • Ductless Mini split
    Thanks for providing this information was of great help for my needs, more information like this is needed, hope you have some things in the future, would love to see more information from you :-)

    baseboard heating |baseboard heating system
  • Well you got a really useful blog I have been here reading for about an hour. I am a newbie and your success is very much an inspiration for me...
  • Great information we looking for more update in this articles
  • Really intelligent piece of writing buddy, keep it up and I will keep tweeting your blog posts for you so you can get the readers you deserve!
  • yavrum be :D
  • sagolasın kardeşim
  • A_stonem
    tj jvyj
  • Tammybecker83

    This seem to good info that a local brand and a retailer is going to be grow and through this info we can make an other brand that can also grow like this brand is growing thanks for this pretty info.

    atlanta tux rental | wedding tuxedo rental atlanta | tux rentals atlanta
  • Tammybecker83
    Those are really good points. Because of the importance of the Internet today, most business people take chances on considering SEO services. Houston-based small company that I own got help from link builders. It’s a coffee shop, by the way. I sometimes get stunned when customers would approach me and tell me that they got the info on how to get to my shop from the internet. So I assume they did a 

    atlanta tux rental | wedding tuxedo rental atlanta | tux rentals atlanta
  • Tammybecker83
    I think you are really an expert in writing unique blog. I am crazy about your thoughts.

    san luis obispo attorneys | san luis obispo lawyers | attorney san luis obispo

  • I am glad to visit your blog.. I found this post is really useful one.. I love reading this kind of stuff. Your blog is one of a kind, i love the way you organize the topics.
  • Jim Neotron
    I just came across to reading your blog it serve very useful information about the interiors thank u


    brakes rochester ny | oil change rochester ny
  • Jim Neotron
    I recently came across your blog and have been reading along. I thought I would leave my first comment. I don't know what to say except that I have enjoyed reading. Nice blog. I will keep visiting this blog very often.brakes rochester ny | oil change rochester ny
  • Excellent articles ...Thanks for your blog, I just subscribe your blog.
  • Great work but I am not that much familiar with this information. So can you provide more information in another blog. I am stay tuned here for your next blog...
  • Tammybecker83
    I recently came across your blog and have been reading along. I thought I would leave my first comment. I don't know what to say except that I have enjoyed reading. Nice blog. I will keep visiting this blog very often.

    spa offers dubai | dubai special offers | promotions dubai
  • Tammybecker83
    Keep on moving that direction and I know that you will have an award, just because students buy essays and the friends of mine should buy research papers or great theme just about this post.

    spa offers dubai | dubai special offers | promotions dubai
  • Tammybecker83
    I just came across to reading your blog it serve very useful information about the interiors thank u


    Residential painting services | Commercial painting services | House Painting Services
  • Tammybecker83
    I just came across to reading your blog it serve very useful information about the interiors thank u


    Residential painting services | Commercial painting services | House Painting Services
  • Tammybecker83

    I just came across to reading your blog it serve very useful information about the interiors thank u


    best mattress deals | king size mattress | queen size mattress
  • Sherylpotts
    Tweening is about the handier functions of Ulead GIF Animator 5. Tweening is
    creating or even updating the frames concerning two main frames. You could tween
    one object move it across your canvas, or tween the transparency on the object
    to make it look to fade in and over. Or both at once...External Portable Hard Drive
  • Thanks for the nice post.
  • I really loved reading your blog, Thanks
  • crina laroa
    Tweening is one of the handier functions. It's very fast when you this gadget. droid mobile phone parental control software
  • It also activates many extra plugins by default, making it extremely
    full-featured..and this is very informative..
  • TweenMax extends the extremely lightweight, fast TweenLite
    engine, adding many useful features like timeScale, AS3 event
    dispatching, updateTo(), yoyo, repeat, repeatDelay, rounding, and more.
    It also activates many extra plugins by default, making it extremely
    full-featured.
  • I just stumbled upon your web blog and wanted to say that I've really enjoyed browsing your blog posts.
  • Im not exactly sure what this does, can you provide a more indepth explanation please?
  • very strong i like it thanks man ... Sydney flowers
  • I wanted to thank you for this special read. I
    definitely savored every little bit of it and I have you bookmarked to check
    out new stuff you post. Web Design Agency
  • I just stumbled upon your weblog and wanted to say that I've really enjoyed browsing your blog posts. Seo UK
  • jeet rai


    I was very
    encouraged to find this site. I wanted to thank you for this special read. I
    definitely savored every little bit of it and I have you bookmarked to check
    out new stuff you post




     karmaloop
    coupon code



  • jeet rai


    I
    havent any word to appreciate this post.....Really i am impressed from this post....the
    person who create this post it was a great human..thanks for shared this with
    us.


     


    Plndr
    Codes



  • Pretty nice post. I just stumbled upon your weblog and wanted to say that I've really enjoyed browsing your blog posts.
  • Pretty nice post. I just stumbled upon your weblog and wanted to say that I've really enjoyed browsing your blog posts.
  • Pretty nice post. I just stumbled upon your weblog and wanted to say that I've really enjoyed browsing your blog posts.
  • It just jumps from start pont to end point. What could be wrong? Digital Agency Glasgow
  • Working with multiple tweens is definitely more complex, though more useful. Glad you provided a clear cut outline.
  • This site serves only one purpose – to provide YOU with money
    saving tips when it comes to purchasing car insurance for young drivers.electric cigarette reviews
  • Time for me to move north as the first few cool gusts from the south
    rustled the tree leaves above. One more shot taken looking south.search engine optimization los angeles
  • you open and allows you to grow with confidence.
    dewalt dw718
  • Theme Designer, but here’s a little trick I picked up this past week from SEO
  • This site is really and i found so many new information from every post. This is really a great post.
  • If possible, as you gain information, would you mind updating your blog with more information.
    Free Bingo No Deposit
  • mobile dj disco glasgow
    Iam glad to see many positive points in this post, writing is simply amazing.
    mobile dj disco glasgow
  • Mivpljaipur
    my tween does not happen. It just jumps from start pont to end point. What could be wrong?
    Thanks Thomas
  • Turner  
    I simply wished to say greetings! Wonderful web site incidentally.

    Turner


  • I love quotations because it is a joy to find thoughts one might have, beautifully expressed with much authority by someone recognized wiser than oneself.
  • I love quotations because it is a joy to find thoughts one might have, beautifully expressed with much authority by someone recognized wiser than oneself.
  • Hello, don't know why, but my tween does not happen. It just jumps from start pont to end point. What could be wrong?
    Thanks
  • Mark Prades
    Great classe ! nice article
  • Sweet!
  • Hicham
    Crazy ideas!!!
    this is a great tween engine!
  • Guilherme Cruz
    Looks cleaner than managing tweening sequences by delays.
  • Strong!!!
  • whats the difference between tweening and tweenmax
  • Strong!
  • high security safes
    the churches and to the progress of the popular movement.

    high security safes
  • Virtual Office London
    This survey will from certainly add to our knowledge, about the film quality.
    Virtual Office London
  • I know you will find a way to take out something good form this too.Payday Loans
  • if this is a faster way to read/write memory  this might indeed be useful for a whole range of applications.
    Instant Payday Loans
  • blog commenting service
    I like the part where you say you are doing this to give back .

    blog commenting service
  • This is a great post!
  • I recently ran into a minor copyright issue while using a jquery plugin.
    disability law firms

blog comments powered by Disqus

Search

Recommended Books

Speaking at FITC Toronto

 

December 2009
M T W T F S S
« Nov   Jan »
 123456
78910111213
14151617181920
21222324252627
28293031  

Preferred Video Tutorial Resolution

  • 1024x768 (53%, 85 Votes)
  • 1280x1024 (15%, 24 Votes)
  • 1920x1080 (15%, 24 Votes)
  • 800x600 (13%, 20 Votes)
  • 480x320 (4%, 6 Votes)
  • 640x480 (0%, 2 Votes)

Total Voters: 160

Loading ... Loading ...