Skip to main content
Participant
October 28, 2023
Question

invalid reference to effect after creating another one

  • October 28, 2023
  • 1 reply
  • 254 views

Im just wondering, how it works?

var sliderX = myLayer.Effects.addProperty("ADBE Slider Control");
sliderX.name = "Size_X";
var sliderY = myLayer.Effects.addProperty("ADBE Slider Control");
sliderY.name = "Size_Y";

 

sliderX.name = "tmp"; // ERROR here, ReferenceError: Object is invalid

This topic has been closed for replies.

1 reply

Dan Ebberts
Community Expert
Community Expert
October 28, 2023

Yes, that's the way it works. If you add a new property to an indexed group, it invalidates all existing references to properties in that group. If you replace your last line with this, it should work:

sliderX = myLayer.Effects.property("Size_X");
sliderX.name = "tmp";