Search code examples
flash-cs5jsfl

full path to selected movieclip on scene via jsfl


I try to find the way to get full path to selected movieclip across jsfl.

I have one movieclip mc1. Inside mc1 i have the second movieclip mc2. I try to get full path to mc2, if i select mc2 and run jsfl command.

Somthing that:

root.mc1.mc2

I cant't find some thng like parent property in symbolInstance


Solution

  • There's not such an analogy in JSFL, as you have to take into account the context of layers and frames, not just instances (timelines).

    Instead, you can either:

    1 - access / edit the clip by the library path

    fl.getDocumentDOM().library.editItem('library/path/to/mc2')

    2 - if you have the mc2 instance selected on stage, grab the library item, and edit that.

    fl.getDocumentDOM().library.editItem(document.selection[0].libraryItem.name);

    Note that the library item "name" is actually the full path to the library item, not just the "name" you see in the library panel.

    With regards to context, the new xJSFL framework has a Context object, designed to return a Context object containing the correct document, timeline, layer & frame. Perhaps get used to basic JSFL syntax, then have a look at that once you're comfortable.

    Hope that helps.