Skip to main content
kasparg56448765
New Participant
December 6, 2017
Answered

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

  • December 6, 2017
  • 2 replies
  • 531 views

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?

This topic has been closed for replies.
Correct answer JoãoCésar17023019

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.

2 replies

JoãoCésar17023019
JoãoCésar17023019Correct answer
Community Expert
December 6, 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.

Brainiac
December 6, 2017

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