Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 12-28-2004, 07:44 PM   #1
tdoublea
Registered User
 
Join Date: Nov 2003
Posts: 189
Default saveDocument troubles

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:
PHP Code:
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(0tStr.lastIndexOf("/"));
newStr += "/";
newStr += newName;
var 
newDoc =  "file:///"+newStr+".fla";
fl.saveDocument(newDoc); 
thanks in advance.
-t
tdoublea is offline   Reply With Quote
Old 12-29-2004, 11:20 AM   #2
hangalot
lala
 
hangalot's Avatar
 
Join Date: Feb 2002
Location: on the road
Posts: 2,858
Default

try exporting the swf, that seems to give the file a changed attribute
__________________
oi poloi
http://www.memorphic.com/news/
hangalot is offline   Reply With Quote
Old 12-29-2004, 01:26 PM   #3
tdoublea
Registered User
 
Join Date: Nov 2003
Posts: 189
Default

thanks for getting back to me hangalot!
the publish first works nicely, but it's not very clean. i want to be able to open the fla file and save it with a new name. i can only seem to get that to work if the fla is changed somehow. let me give a little example of what i'm doing:

i have an fla with a bunch of components in its library. I made a WindowsSWF that has a checklist of those components. when you check off the components you would like to use for a new project, they are assembled on the stage in accordance to which ones chosen, blah blah blah.
all this stuff works, but i would like to save the fla with a new name first, close th original fla, then assemble stuff on the new one, so the original fla will kind of act as a springboard template- nothing will change in it.

i can get it to work with FLfile.copy and save the copy with a new name, close the original fla- but i want it to be able to work on all versions of 7, not just ellipses.

is the saveDocument method the correct method to use if nothing has been changed? i can't seem to get around this.
thanks again

-t
tdoublea is offline   Reply With Quote
Old 12-29-2004, 05:57 PM   #4
hangalot
lala
 
hangalot's Avatar
 
Join Date: Feb 2002
Location: on the road
Posts: 2,858
Default

there is a saveas method as well, and i am not certain if it has the same limitation. i have had some problems with those methods as well, and did bypass it with flFile so i am not the best person to ask

check out the extending flash mailing list on flashguru.co.uk there might be an answer floating in there somewhere. (use google to search the archives)
also guy watson (flashguru) and burak (asvguy) did a mxp to give filesystem access pre 7.2 but it only works on windows machines (nt,2000,xp), but u can force a install of that mxp.
__________________
oi poloi
http://www.memorphic.com/news/
hangalot is offline   Reply With Quote
Old 12-30-2004, 12:21 AM   #5
tdoublea
Registered User
 
Join Date: Nov 2003
Posts: 189
Default

darn. i've tried all the variations. that flfile is a god-send... but it's got to work on both mac and pc and 7 up. i've checked around and there's a wealth of knowledge of how to save, but basically only when things have been changed in the file.
i've got some other ideas, but they're just not pretty...

thanks again.

-t
tdoublea is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT. The time now is 11:26 AM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.