Language: ChineseGermanSpanishFrenchDutchItalianRussian
123 Flash Chat Forums

Go Back   TOPCMM Community > SWFKit > SWFKit Support

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-02-2003, 06:36 PM
Junior Member
 
Join Date: Dec 2003
Posts: 2
Default copy file from CD to HD

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???
Reply With Quote
  #2 (permalink)  
Old 12-02-2003, 07:55 PM
Junior Member
 
Join Date: Dec 2003
Posts: 2
Default Re:copy file from CD to HD

nevermind...

I got it. Thanks.
Reply With Quote
  #3 (permalink)  
Old 01-11-2004, 09:39 AM
Junior Member
 
Join Date: Jan 2004
Posts: 3
Default Re:copy file from CD to HD

I'm trying to do the same thing with a folder of images and I'm interested in how you did this. Can you help out a wet behind the ears flasher wannabe?
Reply With Quote
  #4 (permalink)  
Old 01-11-2004, 11:25 AM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re:copy file from CD to HD

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")
Reply With Quote
  #5 (permalink)  
Old 01-11-2004, 07:43 PM
Junior Member
 
Join Date: Jan 2004
Posts: 3
Default Re:copy file from CD to HD

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
Reply With Quote
  #6 (permalink)  
Old 01-12-2004, 09:32 AM
Senior Member
 
Join Date: Feb 2003
Posts: 212
Default Re:copy file from CD to HD

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")
}

Reply With Quote
  #7 (permalink)  
Old 01-13-2004, 02:24 AM
Junior Member
 
Join Date: Jan 2004
Posts: 3
Default Re:copy file from CD to HD

that would be my problem. thanks for helping with that.
Reply With Quote
  #8 (permalink)  
Old 07-07-2004, 11:07 AM
Junior Member
 
Join Date: Jul 2004
Posts: 1
Default Re:copy file from CD to HD

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.
Reply With Quote
  #9 (permalink)  
Old 07-08-2004, 08:55 AM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re:copy file from CD to HD

The sample shows how to copy a file.
Reply With Quote
  #10 (permalink)  
Old 07-22-2004, 11:00 AM
Junior Member
 
Join Date: Jul 2004
Posts: 2
Default Re:copy file from CD to HD

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)
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 05:46 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.