Skip to main content
Known Participant
Jan 2, 2023 11:47 PM UTC
Question

JSFL Layer selection confusion

I'm trying to write a jsfl script that will go through all selected frames and animate the MCs to fade in, hold for a second, then fade out, then stagger them one after the other.

But I'm having an issue with this, I think it should go through all selected frames, then alert with each of the layer numbers, but it is just repeating the last layer number.

If I have 3 layers, each with a MC, it alerts '2' x3 times in a row, I thougt it should trace '0', '1', '2'.

 

var el ;
var tl = an.getDocumentDOM().getTimeline();
var items = an.getDocumentDOM().selection;

for(var i=0;i<items.length;i++){
	el=items[i];
	el.selected = true;  
	alert(tl.currentLayer)
}

 

This topic is closed to new replies. Start a new post to keep the conversation going.

1 reply

JoãoCésar17023019
Community Expert
Community Expert
Jan 3, 2023 1:06 PM UTC

Hi.

 

Each element is being selected in each iteration but the selected layer is not changing. You should use setSelectedLayers.

 

Please let us know.

 

Regards,

JC

Translate