Passing movies onRelease

hey im using the following code for my main four buttons -


button_array = ["home","plans","terms","contact"];
for (var i in button_array){
this[button_array*].onRelease = function() {
_root.fromName = 0;
content_mc.gotoAndPlay(36);
	_root.fromName = button_array*+"_mc";
};
}

but every button restarts the home_mc clip…

i call it like this in the content_mc clip -


stop();
attachMovie(_root.fromName, _root.fromName, 1);

it also gets removed due to a slide down menu refresh everytime a button is pressed.

SO i have no idea whats going on :expressionless:

in content_mc it stops at 35 and attachs the _root.fromName movie and then when another button is pushed it starts from frame 36 in content_mc and removes the _root.fromName clip.

However _root.fromName = the new clip i want and not the old one.
So in frame 35 i added -

oldMClip = _root.fromName;
attachMovie(_root.fromName, _root.fromName, 1);

and in frame 36 when it gets restarted -

removeMovieClip(oldMClip);

**i dont get why this doesnt work :expressionless:

Um . . . attachMovie grabs a movie clip out of your library then you give it a new name and a depth. Are you sure you are using it right?

:hr:

button_array = [“home”,“plans”,“terms”,“contact”];
for (var i in button_array){
this[button_array*].onRelease = function() {
_root.fromName = 0;
content_mc.gotoAndPlay(36);
** _root.fromName = button_array*+"_mc";**
};
}

well does that pass on a correct name for the movie i want,
i have home_mc in my libary and just added plans_mc and when i click the Plans button it still displays the home_mc clip

ah i thanks for ya help its coz my movie wasnt exported for actionscript