I’ve added Fusekit and Flash to my categories in my blog.
For the people who don’t know about Fusekit, it’s the most powerful tweening engine that I’ve ever used with Flash up to now. It supports Flash 8 filters and also supports callbacks – [ a callback means something is executed after a tween is done, eg. after moving ball_mc from point A to B, you want it to fadeout.]
I always lose the code to do simple stuff with Fuse, that’s why I’m posting them here for easy reference, and hopefully it will help some people out there as well.
Anyway here goes…
To prepare to use Fusekit, you need to do something like a “include” to initialise and package Fuse into your swf. Here is the following lines of code I use:
import com.mosesSupposes.fuse.*;
ZigoEngine.simpleSetup(Shortcuts,PennerEasing,FuseFMP);
FuseFMP can be removed if you do not need to use Flash 8 filters like glow, or blur.
For a callback:
tempMC.slideTo(“0″,380,1,”easeInQuart”,0,{scope:_root, func:hitFloor, args:[tempMC]});
Where tempMC is the MovieClip that you want to tween. slideTo is moving a MovieClip’s _x and _y. Naturally, what follows in the brackets are (_x,_y,time to complete the animation, the easing(must be in quotes), the delay (time to wait until it starts to animate, then the all wonderfull callback – [the callback works like this, scope is where the function is found, func is the function name, without quotes, args is what you want to pass into the function(this is an array).]
Whew, it’s all very long. But in my next post, I’ll show you how I can do a callback another way. The lazy way… Comments and feedback on how to do things better are always welcome. ^^
yo yo! saw this entry and I can’t resist but to leave a comment.
You know about ZigoEngine.register() right? cos that’s the recommended way to use it.
When you do a simpleSetup, it adds those methods like “slideTo” and “fadeTo” to the prototype of the MovieClip & some other classes (I forgot what are the rest!
), which explains why you’re able to use the syntax tempMC.slideTo.
Once you use ZigoEngine.register() to register the required classes, you can call the tweenings in a similar syntax:
ZigoEngine.doTween();
There’s many ways to fire up this function, just hit the docs when in doubt.
Enjoy!
Yep, I knew about it, but I find it so troublesome. MovieClip.slideTo is much simpler, and can do stuff in one line.
Or can I actually do it in one line with this method? =P
The docs are pretty useless in my opinion.
wahaha… the docs are actually useful.
It’s not troublesome la, it’s just for advance use.
For example, if you want to BOTH a fade out and move, I’m not too sure, but maybe you have to do 2 calls?
tempMC.fade() & tempMC.slideTo().
But when you’re using ZigoEngine.doTween(), you can just do in a single call.
ZigoEngine.doTween( tempMC, “_x,_y,_alpha,_xscale,_yscale,_rotation”, [50, 50, 20, 80, 80, 145], 1, “easeOutCubic”, 0 );
See what I mean? hehe…
Check the docs. The docs give you every details that you need, and I learnt all my stuff there. haha.. they’re definitely not useless.
haha, yep, I’ll try to tackle the docs again in the near future. I’ll have lots of time then. =)
hmm… begin with the examples.
They’re like the 101 lessons. haha… after that when you feel like it, then reference to the docs. always helps that way.
erm jus to ask where can i find the docs?
Over here:
http://www.mosessupposes.com/Fuse/fuse2docs/index.html
This is the n-th time I came back to see how to write the callback.. lol
cool stuff, i just recently got into fuse. Been using tweenlite all along. *-*