Copy link to clipboard
Copied
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.
}
solved. I had some bad naming. all good.
First of all: never hardcode a layer index. If you need to look for a specific control layer, do it by name.
Second: Have you tryed to hardcode mNewComp.layer(1)?
Copy link to clipboard
Copied
solved. I had some bad naming. all good.
Copy link to clipboard
Copied
First of all: never hardcode a layer index. If you need to look for a specific control layer, do it by name.
Second: Have you tryed to hardcode mNewComp.layer(1)?