[Golist] Using Go w/HydroTween

burak at delizade.com burak at delizade.com
Thu Jan 17 16:17:36 PST 2008


var f: Fuse = new Fuse();
f.push ...
f push ...
.
.
.
f.start();

(sorry if I understood wrong.) According to your message I understand  
that holding a single tweener object that will be used several times  
without create lots of same creation. But, before, were we able to do  
same with Fuse already like above?

I think I couldnt understant differences before and after versions of  
tweeener(fuse and go) in your message, sorry ;)





From: golist-bounces at goasap.org [mailto:golist-bounces at goasap.org] On  
Behalf Of Moses Gunesch
Sent: Thursday, January 17, 2008 10:06 PM
To: Mailing list for the Go ActionScript Animation Platform
Subject: [Golist] Using Go w/HydroTween

I mentioned that I'd used Go to script a stop-motion animation player,  
which worked great, but hilariously I haven't had a need in my project  
to run any normal tweens, until just yesterday!

So I grabbed Donovan's all purpose tween class, HydroTween, which  
works a lot like Tweener syntax-wise. I had no problems with it  
whatsoever! It was easy... as easy as any other tween engine. Thanks  
Donovan! (available at his Hydrotik.com blog)

Personally for AS3, I like being able to make a tween that you can  
store in a class. I had an animation of a big tab that slides up and  
down for it's show / hide. So instead of making a new tween every  
time, I simply stored one tween as a private class property, then run  
stop(), reset the position and call start() on it to use it. Very  
simple!

I also like this because as3 makes you think about memory management  
and object creation....

Every time you create a callback or event in as3 you're creating a  
method-closure object internally that stores tons of references to its  
surroundings, so they're a bit more prone to memory leaks than other  
features of the language. Object creation also takes time and  
processing. So, having a single tween object in memory with a single  
method-closure reduces the processor hit quite a bit compared to the  
normal actions of a sealed tween engine (which generates and destroys  
new tween instances and closures constantly as it runs).

Go exposes the engine so that you have control over whether you want  
to make a helper class (a la Tweener) to manage tweens for you, or  
whether you want to keep control over them as I did in this example  
and minimize what takes place behind the scenes.

- moses






More information about the GoList mailing list