tdoublea
12-28-2004, 07:44 PM
hello.
i'm trying save an open document with a new name in the same location.
the only problem i am running into is that it will only save with the new name if the open document has been changed (anything to get that asterik next to the file in the API)
is the saveDocument method only used for unsaved current documents? if so what methos should i be using to save an open document with a new name without have the saveAs window appear?
here's the script:
var newName = "my_new_doc";
var my_doc = fl.getDocumentDOM();
my_doc.selectNone();
//get its path
var tStr = my_doc.path;
//get rid of the \'s
var tArr = tStr.split("\\");
var len = tArr.length
tStr = tArr.join("/");
var newStr = tStr.slice(0, tStr.lastIndexOf("/"));
newStr += "/";
newStr += newName;
var newDoc = "file:///"+newStr+".fla";
fl.saveDocument(newDoc);
thanks in advance.
-t
i'm trying save an open document with a new name in the same location.
the only problem i am running into is that it will only save with the new name if the open document has been changed (anything to get that asterik next to the file in the API)
is the saveDocument method only used for unsaved current documents? if so what methos should i be using to save an open document with a new name without have the saveAs window appear?
here's the script:
var newName = "my_new_doc";
var my_doc = fl.getDocumentDOM();
my_doc.selectNone();
//get its path
var tStr = my_doc.path;
//get rid of the \'s
var tArr = tStr.split("\\");
var len = tArr.length
tStr = tArr.join("/");
var newStr = tStr.slice(0, tStr.lastIndexOf("/"));
newStr += "/";
newStr += newName;
var newDoc = "file:///"+newStr+".fla";
fl.saveDocument(newDoc);
thanks in advance.
-t