private function export():void
{
var today_date:Date = new Date();
var thismonth:uint = today_date.getMonth();
var today_time;
var currentTime:Date = new Date();
var minutes = currentTime.getMinutes();
var seconds = currentTime.getSeconds();
var hours = currentTime.getHours() * 30 + currentTime.getMinutes() / 2;
var mnth:Array = new Array('January','February','March','April','May','June','July','August','September','October','November','December');
var fileName:String = (today_date.getDate()+mnth[thismonth]+today_date.getFullYear()+"_"+currentTime.hours + currentTime.minutes + currentTime.seconds+".png");
//trace(fileName);// displays current date in United States date format
var bmd:BitmapData = new BitmapData(board.width, board.height);//(600, 290);
bmd.draw(board);
var ba:ByteArray = PNGEncoder.encode(bmd);
// var file:File = File.applicationDirectory;
//var file:FileReference = new FileReference();
var fs : FileStream = new FileStream();
var targetFile : File = File.documentsDirectory.resolvePath(fileName);
//var targetFile : File = File.applicationDirectory.resolvePath(fileName);
fs.open(targetFile, FileMode.WRITE);
fs.writeBytes(ba);
fs.close();
//file.addEventListener(Event.COMPLETE, saveSuccessful);
saveDialog = new SaveDialog();
addChild(saveDialog);
test = setInterval(showMessage,2000);
//var test = setInterval(showMessage,3000);
saveDialog.closeBtn.addEventListener(MouseEvent.MOUSE_UP, closeSaveDialog);
//file.save(ba, fileName);
}