Fusekit Tutorial #2

Here’s the next tutorial on Fusekit.

As promised, here’s another way to do a callback, the lazy way.

tempMC.slideTo(“0″,380,1,”easeInQuart”,0,function(){
tempMC.alphaTo(0,1,”linear”);
});

As you can see, I literally dumped the whole function inside, instead of writing a new function on its own. Now take note, doing this has its downside. When you try to refer to tempMC, you cannot use this. Try tracing this in the function, and you will get wherever the script is. Like for example, if your code is in the main timeline, you’ll get _root.

That’s basically what I know about callbacks. Perhaps if I missed out something, a pro can add on in the comments? Thanks! Hope this is helpful for everyone.

Edit: Check out the comments to see what a pro has to say! =P

4 Responses to “Fusekit Tutorial #2”

  1. flashmech

    this comment is written for the syntax ZigoEngine.doTween().

    There’s basically 3 types of callbacks:

    start
    Before the tween is being started, this function will fire off first.

    update
    Upon every pulse of the tween (enterframe as some will call it), this function will be fired.

    end
    At the end of the tween, this function will fire off.

    Coupled together with these callbacks, you can also specify the scope of function to be called. Which means that even when you’re calling the tween on the parent scope, you can redirect the callback to a child scope.

    Here’s a sample syntax:

    ZigoEngine.doTween( mc, “_x,_y”, [newX, newY], 1, “easeOutCubic”, 0, { startscope:mc.view, startfunc:”showView”, scope:mc.view, func:”hideView” } );

    In the above example, here’s the arguments:

    • mc – the mc to be tween
    • “_x,_y” – a string format of properties belonging to mc to be tweened
    • [newX, newY] – the individual end results to the properties listed in the previous argument
    • 1 – the duration of the tween in seconds
    • “easeOutCubic” – the formula to use when you register PennerEasing class with ZigoEngine
    • 0 – the delay of the tween in seconds
    • { startscope:mc.view, startfunc:”showView”, scope:mc.view, func:”hideView” } – the various callbacks and scope declaration, in which case, I’m directing the scope to mc.view, which is another movieClip in mc with the instance name of “view”.

    Hope I did not complicate things, but yeah, that’s basically how you are able to do complex callbacks and scoping with Fuse.

    Hope that helps! :)

  2. DarkSuiyoken

    Cool. Definitely will help, but yeah, the ul and li tags don’t work, so it’s in a mess! I try to help you moderate yeah.

  3. flashmech

    wa dun say me pro leh.. I still learning too. :D

    thanks for the edits! Look so much better. I’ll be wiser not to use ul li tags in the future. :P

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>