Move one layer index to a new specified index
I have a composition.
I have 300+ layers. I want to take one layer and move it to a different layer index. Seems simple. I tried moveBefore and moveAfter but its not working right.
I call the comp in question and store it as a variable.
Then i call a particular layers index, and then i want to shuffle it to above another layer in the same comp.
getAComp(compSearchingFor); //this returns mNewComp
if (typeSelect.selection == 2){ // this is a dropdown that is specified
myLayer = mNewComp.layer(62); //establish the layer i want to move
alert(myLayer.name);//alert me just to show this works
mLayer.moveBefore("Layer name");// i tried this with index too, no luck. the error says mLayer is undefined.
}