Question

When I create a movie clip with JSFL and I set the .name parameter - this becomes the name of the Movie Clip as it appears in the library - I want to supply an instance name for the movie clip on the stage however. I've attached a pic to show the field that I'm attempting to populate via JSFL.

Thanks!

enter image description here

Here's the code that sets the name, basically looping through the fl.getDocumentDOM() until I get an array of all elements on stage then once I have an element.

var newMc = fl.getDocumentDOM().convertToSymbol("movie clip", mcName, "top left");
newMc.name = "row_" + rowq.toString() + "_column_"+ colq.toString();
newMc.linkageExportForAS=true;      
newMc.linkageClassName="com.xyz.as3.view.component.Piece";
Was it helpful?

Solution

newMC is the library item rather than the stage instance, but the new instance should be selected now, so you could use:

fl.getDocumentDOM().selection[0].name
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top