سؤال

I am writing a JSFL script that resizes flas and saves various versions, with appened names.

I can get a "Save As" prompt to pop up using fl.saveDocumentAs();

But I can't seem to get flash to generate a new name for the FLA.

I just want to save "document.fla" as "document_foo.fla" ,(and later "document_qux.fla"), preferably without interrupting the script with a "save as" prompt.

هل كانت مفيدة؟

المحلول

thanks, just using fl.saveDocument() works. I used this to rename it and switch Flash's focus to the new version:

var docURI= fl.documents[0].pathURI;// get name&location of current document
var appendName = "_appended.fla";
docURI=docURI.replace(".fla",appendName);//create appended name for new version
//(do stuff to my fla)
fl.saveDocument(fl.documents[0] ,docURI);//save as new doc name
fl.openDocument(docURI);//open this newly saved document

نصائح أخرى

You dont need to use fl.saveDocumentAs().

If the file has never been saved or has not been modified since the last time it was saved, the file isn’t saved and false is returned. To allow an unsaved or unmodified file to be saved, use fl.saveDocumentAs().

Read - http://help.adobe.com/en_US/flash/cs/extend/WS5b3ccc516d4fbf351e63e3d118a9024f3f-7d12.html

Just use fl.saveDocument after each modification.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top