Tweening

what’s good Flash community. I got a lil problem with TimelineLite… the TimelineLite function is not running when called from another function which has been called from yet another function. Here’s the code:

var buttons_array:Array=[mmain,mservices,mshowcase,marsenal,mclientlogin,minquire];

//---------- loop through the buttons array to set up properties and events
for (var i:int=0; i<buttons_array.length; i++)
{
buttons_array*.mouseChildren=false;
buttons_array*.buttonMode=true;
buttons_array*.id=i;
buttons_array*.addEventListener(MouseEvent.ROLL_OVER, onRollover,false,0,true);
buttons_array*.addEventListener(MouseEvent.ROLL_OUT, onRollout,false,0,true);
buttons_array*.addEventListener(MouseEvent.CLICK, buttonClicked,false,0,true);
}

function buttonClicked(event:MouseEvent):void
{
buttonSelected(event.target.id);

if(event.target.name !=lastLoaded)
{
lastLoaded=event.target.name;
container.transit.gotoAndPlay(“motivate”);
showClips();
//TweenLite.to(percent_mc, 1, {y:287, alpha:1, ease:Circ.easeInOut});
}
}

function buttonSelected(id:int):void
{
for (var i:int=0; i<buttons_array.length; i++)
{
if (i==id)
{
buttons_array*.gotoAndStop(“dock”);
buttons_array*.buttonMode=false;
buttons_array*.removeEventListener(MouseEvent.ROLL_OVER, onRollover);
buttons_array*.removeEventListener(MouseEvent.ROLL_OUT, onRollout);
buttons_array*.removeEventListener(MouseEvent.CLICK, buttonClicked);
} else
if(buttons_array*.currentLabel !=“home”)
{
buttons_array*.gotoAndPlay(“close”);
buttons_array*.buttonMode=true;
buttons_array*.addEventListener(MouseEvent.ROLL_OVER, onRollover,false,0,true);
buttons_array*.addEventListener(MouseEvent.ROLL_OUT, onRollout,false,0,true);
buttons_array*.addEventListener(MouseEvent.CLICK, buttonClicked,false,0,true);
}
}
}

//-------------------------------------------------------------------------------------------
var lettersArray:Array=[mc_01,mc_02,mc_03,mc_04,mc_05,mc_06,mc_07,mc_08,mc_09,mc_10,mc_11,mc_12];

for(var k:int=0;k < lettersArray.length; k++)
{
lettersArray[k].alpha=0;
}

var myTimeline:TimelineLite = new TimelineLite({paused:true});
var my2Timeline:TimelineLite = new TimelineLite({paused:true});

myTimeline.append( new TweenLite(mc_01, 2.1, {alpha:1,rotationY:180}) );
myTimeline.append( new TweenLite(mc_02, 2.1, {alpha:1,rotationY:180}) );
myTimeline.append( new TweenLite(mc_03, 2.1, {alpha:1,rotationY:180}) );
myTimeline.append( new TweenLite(mc_04, 2.1, {alpha:1,rotationY:180}) );
myTimeline.append( new TweenLite(mc_05, 2.1, {alpha:1,rotationY:180}) );
myTimeline.append( new TweenLite(mc_06, 2.1, {alpha:1,rotationY:180}) );

my2Timeline.append( new TweenLite(mc_07, 2.1, {alpha:1,rotationY:-180}) );
my2Timeline.append( new TweenLite(mc_08, 2.1, {alpha:1,rotationY:-180}) );
my2Timeline.append( new TweenLite(mc_09, 2.1, {alpha:1,rotationY:-180}) );
my2Timeline.append( new TweenLite(mc_10, 2.1, {alpha:1,rotationY:-180}) );
my2Timeline.append( new TweenLite(mc_11, 2.1, {alpha:1,rotationY:-180}) );
my2Timeline.append( new TweenLite(mc_12, 2.1, {alpha:1,rotationY:-180}) );

function showClips():void
{
trace(“function iz werkin”);
myTimeline.play();
my2Timeline.play();
}

function hideClips():void
{
myTimeline.reverse();
my2Timeline.reverse();
}

As you see, the showClips function calls the myTimeline.play() method. And the showClips function is being called by the buttonClicked function. Now, a trace statement shows that the showClips function is working, but the myTimeline.play() method is not working. When I take the showClips function out of the buttonClicked function, everything works perfectly. So, I’m stuck here. Can anyone look at the code and tell me why the myTimeline.play(); function is not running the way I have the code now…thanks…