• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Scripting the import of a moviefile (for animation-reference)

New Here ,
Dec 06, 2017 Dec 06, 2017

Copy link to clipboard

Copied

For an animated movie production I have to prepare 200+ Animate-projects. I want to do this automatically by using python

to process a list of scenes and then passing all the arguments to a function (with "fl.runScript(functionname, arguments etc...))

So far this all works, but what I cannot figure out is how to use the fljs-scriptlanguage to import a moviefile and place it on the timeline,

So that an animator can use this storyboard-moviefile as a reference.

I was thinking that something like this should work:

var doc =  fl.getDocumentDOM();

var libIndex = doc.library.library.findItemIndex("Sq080_sc210_sh020_animatic_v001");

var myLibItem = doc.library.items[libIndex];

fl.getDocumentDOM().getTimeline().layers[0].frames[0].element[0].libraryItem = myLibItem;

.. but i gives the error: "fl.getDocumentDOM().getTimeline().layers[0].frames[0].element[0] is undefined", which sounds logical.

..because the stage is empty(contains no elements)

How can I add an element to a frame(scriptwise) for linking it to my LibraryItem?

I searched all the contents of:

Adobe Flash Professional * Extending Adobe Flash Professional

But couldn't find anything.

Does anyone have the answer?

Views

276

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Dec 06, 2017 Dec 06, 2017

Try document.addItem() to get an item from any open document or library to the specified Document object

Try fl.copyLibraryItem() to silently copy a library item from a document without exposing the item in the Animate user interface.

Try the document.clipPaste() method to paste the item into the new document.

Votes

Translate

Translate
LEGEND ,
Dec 06, 2017 Dec 06, 2017

Copy link to clipboard

Copied

So you want to use "JSFL" to "add" something to the current document? Googling for those two words gives a link to Adobe's documentation for addItemToDocument as the very first link.

How do I add an object from library to stage using a Flash JavaScript file (.jsfl)? - Stack Overflow

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 06, 2017 Dec 06, 2017

Copy link to clipboard

Copied

LATEST

Try document.addItem() to get an item from any open document or library to the specified Document object

Try fl.copyLibraryItem() to silently copy a library item from a document without exposing the item in the Animate user interface.

Try the document.clipPaste() method to paste the item into the new document.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines