attachMovie with names from an array

Hi, I’m trying to reduce repetition in my code by using a for loop with an attachMovie call.

var names:Array = new Array(name0, name1, name2);
    
    for (i = 0; i < names.length; i++)
    {
        attachMovie(names*, names*, 1)
    }

So I have a bunch of clips in array that I want to attach, and I just want to use the name of the clip as the instance name, but it doesnt seem to work.

Is there a way of doing this?

Thanks in advance