Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
1

invalid reference to effect after creating another one

New Here ,
Oct 28, 2023 Oct 28, 2023

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

TOPICS
Error or problem , Scripting , User interface or workspaces
212
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 28, 2023 Oct 28, 2023
LATEST

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";
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines