- Home
- Tutorials
- Flash
- Intermediate
- save a local copy of file
save a local copy of file

Page 1 of 1
Guy Watson
This user is yet to take control of their account and provide a biography. If you are the author of this article, please contact us via support AT actionscript DOT org.
View all articles by Guy WatsonWritten by: Guy Watson , MX 101
Time: 40 minutes
Difficulty Level: Intermediate
Requirements: Flash MX
Topics Covered: This function is used to save a local copy of a .swf file or a local textfile. This function is used internally by the Macromedia Answers Panel as part of the update process. This function is used to save a local copy of a .swf file or a local textfile. This function is exactly the same as the undocumented Flash 5 function, dashboardSave. It can only be used within the Macromedia Authoring Environment, therefore it can only be used in .swf files that are going to be displayed inside of a panel in the authoring environment. With this function exposed, we can now create things such as self updating custom component user interfaces...
MMSave(target,filename);
The first argument 'target' is a target path to a movieclip or a string variable. If you pass a target path to a movieclip and if this movieclip contains a 'fully loaded' movie, loaded using either of these methods/functions:
loadMovieNum(url,level,method);
loadMovie(url,movieclip,method)
movieclip.loadMovie(url,method);
The second argument 'filename' is the filename of the outputted .swf file. This argument can only be a relative path. If you do specify a directory path, bear in mind, that the document root ( / ) as far as this function is concerned is located in the Configuration directory for your Macromedia Flash MX installation. On Windows ME, the Configuration directory is located in:
C:\Windows\Application Data\Macromedia\Flash MX\Configuration
MMSave(this,"../../../../../guy.swf");
Or if i wanted to save a .swf file in the root of the Configuration directory i could use either of these lines of code:
MMSave(this,"/guy.swf");
MMSave(this,"guy.swf");
Create .swf Code Example:
//create a new movieclip
this.createEmptyMovieClip("holder",1);
//load Macromedia's site navigation into that movieclip
holder.loadMovie("http://www.macromedia.com/uber/nav/global_home.swf");
//check to see if the movie has fully loaded
//before outputting the local file
this.onEnterFrame=function(){
if(holder.getBytesLoaded() == holder.getBytesTotal()){
//save the movie loaded into the holder movieclip
//as macromedia_navigation.swf in the Configuration
//directory on the local computer
MMSave(holder,"macromedia_navigation.swf");
//stop checking to see if the movie has fully loaded
delete this.onEnterFrame;
}
};
mystring="This is some text that i want to save locally";
MMSave(mystring,"mystring.txt");
Spread The Word
4 Responses to "save a local copy of file" 
|
said this on 08 Apr 2009 1:11:21 AM CST
I didn't know that flash
I'll tried this out |
|
said this on 19 Jun 2009 3:07:42 AM CST
Just wanted to say a big
|
|
said this on 20 Nov 2009 12:37:26 AM CST
I didn't know that flash
I'll tried this out |


Author/Admin)