Fuse 2.0 animation
to use the Fuse classes in a custom Actionscript class, here’s how it works:
import com.mosesSupposes.fuse.*;
class customClass{
// constructor
function customClass(){
// this has to be called in the
// constructor function or the
// onLoad function to register the classes
ZigoEngine.register( Fuse, PennerEasing );
var AnimVarFuse = new Fuse();
AnimVar.push(
{
target:this.child_mc,
alpha:100 ,
seconds:0.5,
delay:0.5
},
{
scope:this,
func:functionName
}
);
AnimVar.start();
}
function functionName(){
// this is a function that will be called
// once the animation is over
// the scope refers to where
// the function is declared.. the scope
// can be _root if the function is on
// the highest level
}
}
if two or more objects need to be animated in sequence (object 2 starts animating after object 1 is done animating) this is how the fuse code should look:
AnimVar.push(
{
target:this.child_mc1,
alpha:100 ,
seconds:0.5,
delay:0.5
},
{
target:this.child_mc2,
alpha:100 ,
seconds:0.5,
delay:0.5
},
{
scope:this,
func:functionName
}
);
AnimVar.start();
The since there’s a delay value pushed to the execution queue in the fuse object, this means that after the first object will finish animating then there will be a pause of 0.5 seconds and then the second animation will start
The function part is optional. it is not always required to call a function after the animation is done
Omar,
Thanks for the post on the 2.0 Class declaration w/ Fuse 2. (Ironically, it is exactly what I was looking for!) I also appreciate the descriptive examples
Cheers,
Mike