Skip to main content
Known Participant
July 11, 2018
Answered

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

  • July 11, 2018
  • 1 reply
  • 697 views

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.

This topic has been closed for replies.
Correct answer JoãoCésar17023019

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

1 reply

JoãoCésar17023019
Community Expert
JoãoCésar17023019Community ExpertCorrect answer
Community Expert
July 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