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

JSFL error: TypeError: fl.selectElement is not a function

Explorer ,
Jul 11, 2018 Jul 11, 2018

An issue I'm having in Animate CC with a JSFL script, just trying to select an element.

A symbol is on the stage, then on running this jsfl script I get an error.

var el = fl.getDocumentDOM().getTimeline().layers[0].frames[0].elements[0];

fl.trace(el); // returns: [object SymbolInstance]

fl.selectElement(el, false); //returns: TypeError: fl.selectElement is not a function

It looks like it can find the element, and trace the[object SymbolInstance] but I can't select it.

641
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

correct answers 1 Correct answer

Community Expert , Jul 11, 2018 Jul 11, 2018

Hi.

It seems that this method will only work with fl.findObjectInDocByName() or fl.findObjectInDocByType() according to the official documentation.

In my understanding, it should work with a direct reference to an element.

My workaround for you will be to use the selected property. Like this:

el.selected = true;

I hope this helps.

Regards,

JC

Translate
Community Expert ,
Jul 11, 2018 Jul 11, 2018
LATEST

Hi.

It seems that this method will only work with fl.findObjectInDocByName() or fl.findObjectInDocByType() according to the official documentation.

In my understanding, it should work with a direct reference to an element.

My workaround for you will be to use the selected property. Like this:

el.selected = true;

I hope this helps.

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