i'm facing a really weird behavior, and I was wondering what i've been doing wrong.
I'm creating a new adjustement layer, and I want to add 3 slider controls on it and customize them.
This is the code I wrote:
Code: Select all
var Controler = myObj.ActiveLayers.addSolid([1,1,1], "Controler", myObj.ActiveComp.width, myObj.ActiveComp.height, myObj.ActiveComp.pixelAspect, myObj.ActiveComp.duration);
Controler.transform.opacity.setValue(0);
Controler.adjustmentLayer = true;
// adding sliders control to controler
var SliderOne = Controler.property("ADBE Effect Parade").addProperty("ADBE Slider Control");
var SliderTwo = Controler.property("ADBE Effect Parade").addProperty("ADBE Slider Control");
var SliderThree = Controler.property("ADBE Effect Parade").addProperty("ADBE Slider Control");
SliderOne.property("ADBE Slider Control-0001").setValue(20);
SliderOne.name = "First Opacity";
SliderTwo.property("ADBE Slider Control-0001").setValue(20);
SliderTwo.name = "Second Opacity";
SliderThree.property("ADBE Slider Control-0001").setValue(20);
SliderThree.name = "Third Opacity";
But if I write the code this way, it works:
Code: Select all
var Controler = myObj.ActiveLayers.addSolid([1,1,1], "Controler", myObj.ActiveComp.width, myObj.ActiveComp.height, myObj.ActiveComp.pixelAspect, myObj.ActiveComp.duration);
Controler.transform.opacity.setValue(0);
Controler.adjustmentLayer = true;
// adding sliders control to controler
var SliderOne = Controler.property("ADBE Effect Parade").addProperty("ADBE Slider Control");
SliderOne.property("ADBE Slider Control-0001").setValue(20);
SliderOne.name = "First Opacity";
var SliderTwo = Controler.property("ADBE Effect Parade").addProperty("ADBE Slider Control");
SliderTwo.property("ADBE Slider Control-0001").setValue(20);
SliderTwo.name = "Second Opacity";
var SliderThree = Controler.property("ADBE Effect Parade").addProperty("ADBE Slider Control");
SliderThree.property("ADBE Slider Control-0001").setValue(20);
SliderThree.name = "Third Opacity";
For exemple, try adding after the second code this line and the execution will fail:
Code: Select all
alert(SliderOne.name);
Any hints ?