Skip to content

Commit

Permalink
Publish for LWF: Save backup for preserving the original fla file
Browse files Browse the repository at this point in the history
  • Loading branch information
splhack committed Feb 27, 2014
1 parent de146fb commit 875bd4d
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tools/flash/Publish for LWF.jsfl
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -43,8 +43,25 @@ function main()
fl.showIdleMessage(false); fl.showIdleMessage(false);


doc = fl.getDocumentDOM(); doc = fl.getDocumentDOM();
if (doc.getPlayerVersion().match(/^FlashLite/)) {
if (! confirm("WARNING: the current player version is "
+ doc.getPlayerVersion()
+ ". Can we continue to publish?")) {
return;
}
}

lib = doc.library; lib = doc.library;
var uri = doc.pathURI; var uri = doc.pathURI;
if (! uri) {
if (fl.saveDocumentAs(doc)) {
uri = doc.pathURI;
} else {
return;
}
}
FLfile.remove(uri + '~');
FLfile.copy(uri, uri + '~');
flaDir = uri.substr(0, uri.lastIndexOf("/") + 1); flaDir = uri.substr(0, uri.lastIndexOf("/") + 1);
flaName = uri.substr(flaDir.length); flaName = uri.substr(flaDir.length);
flaName = flaName.substr(0, flaName.lastIndexOf(".")); flaName = flaName.substr(0, flaName.lastIndexOf("."));
Expand Down

0 comments on commit 875bd4d

Please sign in to comment.