简体   繁体   中英

How to change Item's “Component definition” in library in Flash by jsfl?

I want to change "Component definition"(I don't know what is in English version's Flash) of Item in library.

Item is a simple MC or Component.A MC will be changed into Component by add Component definitions.

The place to add "Component definition" like this 图片

Sorry, I'm using Chinese version.

So I have learnt JSFL and there is parameter Object can change existed parameter of Element in timeline.But it can reach "Component definition" in Item.Doc says it is AS 2.0 Array.And I can also find it in AS 3.0.

But I only want to know how to add parameters in item by JSFL.

Thanks!!!

Finally ,I did all I can do to find out that there is noly a way to achive it.

1.Create an empty .xfl file in your extendsion.
2.Use jsfl to open it when user want to add "Component definition" of items in library.
3.Use jsfl copy the item into .xfl and save the .xfl.
4.Go to .xfl saved folder and find the item's .xml you want edit.Read the .xml file and edit the "Component definition".Then save the .xml.
5.Reopen the .xfl you can find the "Component definition" has been changed.
6.Copy the changed item to user document(.fla),it can replace the old one.

The 6 steps above just need jsfl and a empty .xfl in your extendsions or save in the location that you can find it on run time.

I had thought that why Adobe didn't give me a simple API to change the "Component definition" just like what I do in Flash.exe?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM