How to pass variables to attachMovie syntax

I’m trying to create a function that can pass a variable to an attachMovie syntax. I’m doing this incorrectly, and I’m having difficulty looking for the right language to find out how to solve this problem. The movieclip that I am attaching is being exported with a “-m”, and so I thought I would use the syntax ‘variable + “-m”’, which is not working.

If anyone can point me to the right resource or has a simple answer for this, that would be great:

go (passThis);

function go (passer) {
_root.attachMovie(passer+"-m", passer, 1);
}

Thanks.

the new instance name should be in quotes…
so it goes…

_root.attachMovie(passer+"-m", “passer”, 1);

Thanks, this is helpful. Is there by any chance a method in which I could pass the same variable name as the new instance name as well?

i didn’t notice that u were trying to use the same variable as a new instance name…by the have you tried out your code…
your code works perfectly fine:ne:

I found my mistake: When I was passing the variable when I called the function, I did not put the variable in quotes.

I was doing this:

go(myclip);

instead of doing this:

go(“myclip”);

Thanks for replying. It was good to go through the motions.