Language: ChineseGermanSpanishFrenchDutchItalianRussian
123 Flash Chat Forums

Go Back   TOPCMM Community > SWFKit > SWFKit Support

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-26-2004, 04:52 PM
Junior Member
 
Join Date: Jul 2004
Posts: 3
Send a message via AIM to dabblin Send a message via MSN to dabblin Send a message via Yahoo to dabblin
Default SWF Save to Floppy

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
Reply With Quote
  #2 (permalink)  
Old 07-27-2004, 03:22 PM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re:SWF Save to Floppy

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);***
}
Say you want to save a file "c:\1.txt" to the floppy disk before exit, you can call the function like this:
Code:
getMainWnd().onClose = function ()
{
***copyFileToFloppy("c:\\1.txt");
}
Reply With Quote
  #3 (permalink)  
Old 07-27-2004, 10:57 PM
Junior Member
 
Join Date: Jul 2004
Posts: 3
Send a message via AIM to dabblin Send a message via MSN to dabblin Send a message via Yahoo to dabblin
Default Re:SWF Save to Floppy

Thanx a bunch... I'll try it out ;D
__________________
Don't hurt the Newbie
Reply With Quote
  #4 (permalink)  
Old 07-27-2004, 11:19 PM
Junior Member
 
Join Date: Jul 2004
Posts: 3
Send a message via AIM to dabblin Send a message via MSN to dabblin Send a message via Yahoo to dabblin
Default Re:SWF Save to Floppy

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
Reply With Quote
  #5 (permalink)  
Old 07-28-2004, 03:44 PM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re:SWF Save to Floppy

The trace window is minimized at the left-bottom corner of the desktop when you preview a project.
Reply With Quote
Reply

Was this information helpful?    Yes No



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 10:19 AM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.