Tweening got you down?

| 4 Comments

Just in case you missed the thread on FlashCoders... Ladislav Zigo has compiled an excellent page that you need to visit if you've ever wanted to tween with ActionScript - Tweening classes and prototypes benchmarked.

The page allows you to see the various tween engines in action, and offers the source code fo download as well. Each tween test offers an avarage frames per second calculation when the test is complete for comparison purposes. The difference between some of the engines is pretty astounding.

While you're at it, also check out the Custom Easing function generator Ladislav made as well. It's a great way to visually create your tween to get exactly the effect that you're looking for.

Excellent work Ladislav!

4 Comments

Thanks for the link Darron. I have played with Zeh's tweening prototypes in the past with joy, I knew loco had adapted that to AS2.

These all come too handy for me. thanks again.

ilteris

I'm new to programming in flash. How do you make an object adhere to these easing functions. Sorry for my ignorance, but I need some basic help in attaching these functions to the objects on my stage.

Thanks

Darrell - On the tweening benchmark page there are links to the source code for each demonstration. I highly recommend you look through them all to get acquainted with tweening via script. Because each engine is different, I can't give you detailed instructions that will work in every case.

An example (from a .fla in a souce .zip file on the page - this is the "Tweening prototypes for AS 2 1.1.1" engine):

// start code
#include "lmc_tween_as1.as"

myMovieClip.tween("_width", 550, 10, "easeoutbounce");
// end code

Just replace myMovieClip with the instance name of your movie clip on the stage. You'll also need to adjust the other parameters to get the tween effect that you want.

Good luck!

Darron - your example above works great.

but when i try the same thing using the AS2 version it just sits there, then suddenly appears at the endstate. real strange. any ideas? the code is exactly the same, i'm just calling the different .as file with the include #.

Leave a comment



About this Entry

This page contains a single entry by darron published on February 9, 2004 12:07 PM.

Context Menus are great, but... was the previous entry in this blog.

Design Tweakage is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.

Archives

OpenID accepted here Learn more about OpenID
Powered by Movable Type 5.02