|
|||
|
trying to write a script to copy file from CD project to a user's harddrive...
Please excuse the naivity, we're having a problem with our script: var ourFile = FlashPlayer.getVariable("inPath"); var file = new File (ourFile); var f = "Text files(*.txt)|*.txt|"; var res = Dialogs.fileSave(f, ".txt", "test"); var outPath = res; file.copy(outPath); This works great the first time, the second time you call the script you get: Warning - unknown method "copy" Can anyone help??? |
|
|||
|
Code:
function myCopyMethod(srcName)
{
if (!File.exists(srcName)) return false;
var path = Dialogs.browse("Please choose a folder:");
if (path == false) return false;
path += "\\";
var file = new File(srcName);
path += file.name;
return file.copy(path);
}
myCopyMethod("c:\\1.txt")
|
|
|||
|
thanks for the quick reply. now i get to show just how slightly retarded i am. where do i put the code? on the button instance would be my guess since i only want the files to copy when the user clicks the download button.
I've tried putting the above code on the button but nothing happens. I'm guessing that I need to change srcName to the name of the file too but I keep getting errors in flash when I do that. i greatly appreciate any help |
|
|||
|
I think you're putting the code in the flash environnement.
You have to put the code in the swfkit environnement, and then call it from within flash You put the script in SWFkit and name it something like "Filecopy" In flash your button code should then be on(release){ FSCommand("FFish_Run", "Filecopy") } |
|
|||
|
I've been trying to get this to work for the last 3 hours without success.
I can get the script to run and show the save/browse dialog, but the copy function just doesn't do anything. Can anyone help? Working sample code would be greatly appreciated. By the way I'm running SWIFKit Pro 2.1. |
|
|||
|
this method is what i've been looking for, but unfortunately it doesn't work on my test pc...
it tries to save and let my choose the destination, the application will be shut down by win xp after pressing the ok button though. the file will not be copied. somthing's wrong with the files or my XP? is there a chance to use the feature in a mac projector as well? dvsn (swfkit newbie - just downloaded the try out. need to include the copy feature on my cd-rom asap) |
![]() |
Was this information helpful? Yes No
| Thread Tools | |
| Display Modes | |
|
|