Critical >>> ELSE STATEMENT ....AS 3.0

hey guys…having some trouble with my conditional statement.

I have six buttons on the stage. Now, when a user selects a button, I need the previously selected button to go to its “close” frame. As I have it now, when a user selects a button, ALL THE other buttons go to their “close” frame label when only the previous button that was open should go to its “close” frame.

here’s the code that works perfectly for me. I just need help only with the else statement :

// wild card var to hold what last movie was loaded
var lastLoaded:*;

var buttons_array:Array=new Array(xadvertising,xbranding, xcatalog, xgraphics,xeditorial,xbio,xcontact);

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);
buttons_array*.addEventListener(MouseEvent.ROLL_OUT, onRollout);
buttons_array*.addEventListener(MouseEvent.CLICK, buttonClicked);
}

function onRollover(event:MouseEvent):void
{
event.target.gotoAndPlay(“open”);
}

function onRollout(event:MouseEvent):void
{
event.target.gotoAndPlay(“close”);
}

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

if(event.target.name !=lastLoaded)

{
lastLoaded=event.target.name;
container.gotoAndPlay(“motivate”);
}
}

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 {
buttons_array
.gotoAndPlay(“close”);
buttons_array
.buttonMode=true;
buttons_array*.addEventListener(MouseEvent.ROLL_OVER, onRollover);
buttons_array*.addEventListener(MouseEvent.ROLL_OUT, onRollout);
buttons_array*.addEventListener(MouseEvent.CLICK, buttonClicked);
}***
}
}

// function to call exchange movies
function exchangeMovies():void
{
my_loader.load(new URLRequest(lastLoaded+".swf"));
}

thanks for any time…

x lisa x