|
|||
|
I've had SWF Kit PRO 2.0 for about 2 days now and haven't had much time to look through the help files. I need a quick tutorial on adding a call to my swf to allow it to save data to a floppy disk. To be more specific, I have a base swf file that tracks navigation through an instructional course, and when the user is ready to exit and bookmark there place in the course, flash must write this data to a floppy instead of using a regular Shared Object on the users hard drive. If anyone can help it would be appreciated.
__________________
Don't hurt the Newbie |
|
|||
|
The following function can save a file to the floppy disk:
Code:
function copyFileToFloppy(filename)
{
***if (!File.exists(filename)) return false;
***
***var drive = new Drive("a:");
***while (!drive.isReady)
***{
******if (Dialogs.msgBox("Please insert a floppy disk", "Copy file", 1 | 32) != 1)
*********return false;
***}
***
***var file = new File(filename);
***var destName = "a:\\" + file.name;
***
***return file.copy(destName);***
}
Code:
getMainWnd().onClose = function ()
{
***copyFileToFloppy("c:\\1.txt");
}
|
|
|||
|
script looks fine! Thanx again!!!!!
I call it from within flash using: fscommand("FFish_Run","save"); however it dose not exectue the functions: //save function copyFileToFloppy(filename){ if (!File.exists(filename)) return false; var drive = new Drive("c:"); /* While (!drive.isReady) // if (Dialogs.msgBox("Please insert a floppy disk", "Copy file", 1 | 32) != 1) return false; */ // var file = new File(filename); var destName = "c:\\" + file.name; return file.copy(destName); } // getMainWnd().onClose = function(){ copyFileToFloppy("c:\\1.txt"); } which i modified this and the other function to save to the c drive, because my laptop at home has no floppy and I just wanted to test it out. Also, I've tried running trace() commands in the SWFKit Scripts but haven't been able to find them. Are they in the Watch tab?
__________________
Don't hurt the Newbie |
![]() |
Was this information helpful? Yes No
| Thread Tools | |
| Display Modes | |
|
|