Hey there,
I am currently trying my 5. workaround to get my menu done. . I want to move a series of 4 buttons up, after a click and when all buttons finished their movement I want the bottom 3 to move down again.
My big problem ist, that I dont get a check working to see if the function move() hast finished in order to fire the function open(). Is there any listener or so?
Here is my code:
Code:
//Setup and register with Zego Engine
import com.mosesSupposes.fuse.*;
ZigoEngine.simpleSetup( Shortcuts, PennerEasing, Fuse );
//-----------------------------------------------------------
//Setup Variables
var projects_counter:Number = 1;
//trace("initial projects_counter = "+projects_counter);
var max:Number = 6;
var myListener = new Object();
//-----------------------------------------------------------
function move() //starts the movement of all projects, y:"movement target in absolute coords")
{
for ( var s = 0; s < max; s++ )
{
var f:Fuse = new Fuse ();
f.push ([
//{target: _root["project"+(projects_counter+1-s)], y: 100-(s*35), time: 1+(1/((1/s)+1)), ease:"easeOutQuint"}, //move all elements with smaller index than the clicked one
{target: _root["project"+ (projects_counter+s)], y: 100+(s*35), time: 1+(1/((1/s)+1)), ease:"easeOutQuint"} //move all elements with higher index and including the clicked one
]);
f.start();
}
}
function traceFunction()
{
trace("TWEEN COMPLETE")
}
function open() //opens the menu for the content, y:"opening value (relative distance)"
{
for ( var n = 1; n < max; n++ )
{
var f2:Fuse = new Fuse ();
f2.push (
{target: _root["project"+(projects_counter + n+1)], y:"200", delay: 0.2, time: 2+(1/((1/n)+1)), ease:"easeOutBack"}
);
f2.start();
//trace("(open) n = "+n);
}
}
_root.project1.onPress = function()
{
projects_counter = 1;
move();
move.addListener(Event.COMPLETE, traceFunction);
}
I attached the fla file, too.
Many thanks in advance!!