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

How to choose a specific layer?

Contributor ,
Oct 01, 2022 Oct 01, 2022

截屏2022-10-01 下午3.16.45.png

TOPICS
ActionScript , Code , Exchange extensions
1.0K
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 01, 2022 Oct 01, 2022

var layerIndex = fl.getDocumentDOM().getTimeline().findLayerIndex("your_layer_name");


fl.getDocumentDOM().getTimeline().setSelectedLayers(layerIndex[0], true); 

/* if you have same named layers, index 0 might not be what you want. */

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
Contributor ,
Oct 01, 2022 Oct 01, 2022

still doesn't work截屏2022-10-02 下午12.08.27.png

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
Contributor ,
Oct 01, 2022 Oct 01, 2022

is there an error截屏2022-10-02 下午12.56.24.png

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
Contributor ,
Oct 01, 2022 Oct 01, 2022
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
Contributor ,
Oct 01, 2022 Oct 01, 2022

Still not working

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 02, 2022 Oct 02, 2022

the code i suggested works.  if you have an error it's elsewhere.

 

if you want me to download your file and fix those error(s), you'll need to tell me what you want the code to do and you'll need to hire me.  ie, i generally don't download and correct errors unless i'm paid.

 

free help i offer via the adobe forums.

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
Contributor ,
Oct 03, 2022 Oct 03, 2022

🙃

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
Contributor ,
Oct 03, 2022 Oct 03, 2022

thank you solved,your answer is correct

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 04, 2022 Oct 04, 2022

you're welcome.

 

p.s. mark the correct post, if you have time.

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
Contributor ,
Oct 04, 2022 Oct 04, 2022

Just tried it, still doesn't work

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
Contributor ,
Oct 04, 2022 Oct 04, 2022

You can open my project file and test it

an.getDocumentDOM().enterEditMode('inPlace');                                                          

var layerIndex = fl.getDocumentDOM().getTimeline().findLayerIndex("layer_3");

an.getDocumentDOM().getTimeline().setSelectedLayers(layerIndex[0], true); 

an.getDocumentDOM().setElementProperty('firstFrame', 5-1);                                          

an.getDocumentDOM().exitEditMode();     
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 04, 2022 Oct 04, 2022
LATEST
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