开发者

full path to selected movieclip on scene via jsfl

开发者 https://www.devze.com 2023-03-10 08:01 出处:网络
I try to 开发者_StackOverflowfind the way to get full path to selected movieclip across jsfl. I have one movieclip mc1. Inside mc1 i have the second movieclipmc2.

I try to 开发者_StackOverflowfind 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


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消