menu_obj.copyDatabaseActionScript_funct = function()
{
	// convert database object into XML
	var new_xml = new XML();
	#include "functions/writeXml.as"
	writeXml( database, new_xml );
	var export_xml = new_xml.firstChild;
	
	// convert the XML into actionscript
	var saveString = String(export_xml);
	
	// convert \ to \\
	saveString = saveString.split( "\\" ).join("\\\\");		// replace \ with \\
	
	// replace carriage returns with \r
	var enter_str = String.fromCharCode( 13 );
	saveString = saveString.split( enter_str ).join("\\r");
	
	// construct linkage AS
	var linkageString = "";
	var pages = Math.ceil(saveString.length / 30000);
	for(var p=0; p<pages; p++)
	{// for:  every 30000 characters
		var writeOffset = p*30000;
		var stringChunk = saveString.substr( writeOffset, 30000 );
		if(p==0){
			linkageString += "data_txt = '"+stringChunk+"';\n\n";
		}else{
			linkageString += "data_txt += '"+stringChunk+"';\n\n";
		}
	}// for:  every 30000 characters
	linkageString += '\n\n\ndata = new XML(data_txt);\nonLoad( data );';
	
	// copy XMl to clipboard
	System.setClipboard( linkageString );
	
	// prompt
	mdm.Dialogs.prompt("ActionScript-formatted database data has been copied to the clipboard.");
}// copyDatabaseActionScript_funct()