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

JSFL/XMLUI menulist/menupop help

Community Beginner ,
Nov 05, 2024 Nov 05, 2024

I am new to Animate (2024) scripting, but have created CEP Panels/extendscript for AE and PPro.

 

This forum has been very useful (especially  @JoãoCésar )  as there is a lot of outdated documentation that can be confusing.

 

Basically, I just want a UI for our pipeline. First part is reading a folder on our server and populating a dropdown with the names of all the job folders. 

 

I can read the job names (folder names) into an array and then use a loop to create the xml with all the menulist menuitems. I will have other dropdowns that need to be populated based on other dropdowns.

How would I update a dropdown with new items? Do I somehow close the dialog, create a new xml and open it again?

 

I was looking at https://github.com/AdobeDocs/developers-animatesdk-docs/blob/master/XMLUI_object/xmlui8.md

fl.xmlui.setControlItemElements("myControlID", arrayOfElementObjects);


This is exactly what I need. I create the arrayOfElementObjects and add id to my menulist(tried menupop too), but it doesn't work. The docs say it is for comboboxes and listboxes, but I am not sure how to create these? 

I hoping someone can help me with what is possible in today's animate. 

thank you



 

 

TOPICS
Code , Exchange extensions
660
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 ,
Nov 06, 2024 Nov 06, 2024

Hi.

 

Glad to know that the forums have been useful to you!

The approach that I use is to modify the panel's XML string by adding as much <menuitem/> elements as I need.
image.png

These two examples may give you an idea:
https://github.com/joao-cesar/adobe/tree/master/animate%20cc/jsfl/change_font_face

https://github.com/joao-cesar/adobe/tree/master/animate%20cc/jsfl/replace_unavailable_fonts

This page is old but it has the most complete reference of the XMLUI elements that can be used:
https://web.archive.org/web/20121223105042/http://photoshop-flash-coreldraw-seo-help.com/adobe-flash...

Please let us know if you still need help.

 

Regards,

JC

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 Beginner ,
Nov 06, 2024 Nov 06, 2024

Thank you for your reply and example!

 

I am wondering that once you create the menuitems xml and then create the dialog with fl.xmlPanelFromString, is it possible to then change the menuitems in the same dropdown? In extendscript scriptUI it is done by clearing the items and adding new ones. 


Also, your example has the same issue I was seeing in my tests. The dropdown only opens when you click along the bottom of the dropdown. I found that if I just move it later in a dialog eg. after another hbox, it behaves properly. ie. I can click anywhere in the dropdown and it opens. (this is Animate 2024 on windows).

 

Thank you again!

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 ,
Nov 07, 2024 Nov 07, 2024

You're welcome.

 

What do you mean by changing the menuitems in the same dropdown?

As for the second issue, are you referring to a bug in which the dropdowns cannot be opened by clicking on them?

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 Beginner ,
Nov 07, 2024 Nov 07, 2024

If I have 2 dropdowns.  What I select in Dropdown1 affects what is in Dropdown2. Is this possible anymore? 

 

Dropdowns not opening looks like a bug, but it's always hard for me to know with Adobe apps. Is it a bug or a feature? For this issue, I can open the dropdown, but only if i click in the row of pixels along the bottom of the dropdown.

 

thank you again!

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 Beginner ,
Nov 07, 2024 Nov 07, 2024

I think  fl.xmlui.setControlItemElements("myControlID", arrayOfElementObjects) is for actionscript comboboxes/listboxes. I wonder if they can be created via xml since it is a xmlui method?

One hack that I tried it to use 
fl.xmlui.accept() to close the dialog, then create a new xml and open that. There is a glitch when "old" dialog close and "new" one opens. Not sure if there are any option on how dialogs visually open and close..  

Hoping there are more elegant solutions!

 

 

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 Beginner ,
Nov 07, 2024 Nov 07, 2024

Sorry for my lack of animate knowledge. After more investigating, I think I need to create a swf panel? Will I then be able to populate an actionscript combobox with data from jsfl code?

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 Beginner ,
Nov 07, 2024 Nov 07, 2024

just tried an example and looks like i will be able to do it! very exciting...

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 ,
Nov 08, 2024 Nov 08, 2024

Hi again.

 

Yeah, I would recommend using a SWF panel, because the XMLUI is more of a one-shot thing, so you would have to keep doing these hacks to extend the UI's lifecycle.

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 ,
Nov 08, 2024 Nov 08, 2024
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