Language: ChineseGermanSpanishFrenchDutchItalianRussian
123 Flash Chat Forums

Go Back   TOPCMM Community > SWFKit > SWFKit Pre-sales

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-22-2003, 06:17 PM
Member
 
Join Date: Jan 2003
Posts: 56
Default file copying FFish code?!?

hiya again guys,
i've been working non-stop with ffish coding and i'm starting to pick it up. it's quite easy!

now I ran into a bit of a halt, heh, there goes the easy part, correction, easy MOST of the time.

anyhow, here's my problem:

I looked through the ffish manual and found out how to copy a file:

file.copy(dest)

but my question is that when I used this coding, it wouldn't copy the file. So how can you copy a file? Here's what I'm trying to do:

I have a .swf file in a folder. I'm trying to copy that file and make a duplicate that is copied to the desktop with a name the user specifies. How would you do this??? Thanks!!!!
Reply With Quote
  #2 (permalink)  
Old 01-22-2003, 08:42 PM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re: file copying FFish code?!?

The code copies the main movie to the desktop
Code:
var movies = getMovies();
var f = new File(movies[0]);
var path = Shell.getSpecialFolder("desktop");
path += "\\dest.swf";
f.copy(path);

Reply With Quote
  #3 (permalink)  
Old 01-22-2003, 09:30 PM
Member
 
Join Date: Jan 2003
Posts: 56
Default Re: file copying FFish code?!?

hi again,
the code works perfectly exept for one fact, I've been trying to change it to move a .swf file not in the projector, the code above moves the projector file... so here's what I've been trying to do:


var movies = getAppDir();
trace(movies);
movies += "\\" + swfname + ".swf";
//var f = new File(movies[0]);
var path = Shell.getSpecialFolder("desktop");
path += "\\" + swfname + "\\" + swfname + ".swf";
movies.copy(path);

I don't know if it works, but I'm trying to move a .swf file that's in the same directory as the projector, and I'm trying to copy it to a folder that has a varible name, swfname, with the swf file having the same name. I have gotten the html and txt working, but I can't get this copy swf from directory to new folder working. Would you be able to help out???
Thanks so much, and I look forward to a fast reply!
--adan
Reply With Quote
  #4 (permalink)  
Old 01-22-2003, 09:58 PM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re: file copying FFish code?!?

Code:
var movies = getAppDir(); 
trace(movies); 
movies += "\\" *+ swfname + ".swf"; *
//var f = new File(movies[0]); *
var path = Shell.getSpecialFolder("desktop"); *
path += "\\" + swfname + "\\" *+ swfname + ".swf"; *
movies.copy(path); *
Do you want to create a new folder on the desktop? You should create the folder first.

Code:
var movies = getAppDir(); 
var swfname = "no";
trace(movies); 
movies += swfname + ".swf"; *
//var f = new File(movies[0]); *
var path = Shell.getSpecialFolder("desktop"); *
path += "\\" + swfname;

if (!Folder.exists(path))
{
 * * *new Folder(path);
}

path += "\\" *+ swfname + ".swf"; *
(new File(movies)).copy(path); *
Reply With Quote
  #5 (permalink)  
Old 01-23-2003, 08:24 AM
Member
 
Join Date: Jan 2003
Posts: 56
Default Re: file copying FFish code?!?

thanks for the help, I already was using a create new folder ffish code which created a folder with the varible "swfname", anyway, I'll try the coding out and get back with you, thanks for the help, and I look forward to purchasing your product.
-adan
Reply With Quote
  #6 (permalink)  
Old 01-23-2003, 08:48 PM
Member
 
Join Date: Jan 2003
Posts: 56
Default Re: file copying FFish code?!?

Hi again,
Well the code worked... for a while, strage huh?

Well here's what I've ended up with:

var movies = getAppDir();
trace(movies);
movies += swfname + ".swf";
//var f = new File(movies[0]);
var path = Shell.getSpecialFolder("desktop");
path += "\\" + swfname;
path += "\\" + swfname + ".swf";
(new File(movies)).copy(path);

for some strange reason, it will create a folder with the varible name (lets say for example '3drush') and name it .swf, so now I have a folder being created where the movie should be with the name: 3drush.swf

??? this is strange!?
I had it working for a bit.. but for some strange reason it stopped copying the file, and started creating this weird folder. I have the movie 3drush.swf located with the projector file, and located in almost any folder that might require it, but for some strange reason, it doesnt want to create a copy?

any help? thanks!!
--Adan
Reply With Quote
  #7 (permalink)  
Old 01-23-2003, 09:07 PM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re: file copying FFish code?!?

If the source file does not exist, the expression "new File(name)" will create a folder, and the "copy" method will copy the folder to the destination.

To make sure the source file exists, use the "File.exists" please
Code:
var movies = getAppDir();  
trace(movies);  
movies += swfname + ".swf";  
//var f = new File(movies[0]);  
var path = Shell.getSpecialFolder("desktop");  
path += "\\" + swfname; 
path += "\\" + swfname + ".swf";  
if (File.exists(movies)) (new File(movies)).copy(path);
Reply With Quote
  #8 (permalink)  
Old 01-24-2003, 10:04 PM
Member
 
Join Date: Jan 2003
Posts: 56
Default Re: file copying FFish code?!?

thanks for the help again,
I found out that it was calling the file from the temporary directory... where it was being previewed, thats why it couldn't find the 3drush.swf in the directory, because I had it only in the build directory. Anyhow, I learned my lesson there, and I hope that if anybody reads this, they will make sure not to be that stupid.

ok, well moving on to bigger things... is there a way you can open a popup window with ffish? I've been looking around for a way to work with only flash, no html page beacause I would like to have a popup window appear when you click a button like preview.

So is there any code in ffish that allows you to popup a browser window?

Thanks!
Reply With Quote
  #9 (permalink)  
Old 01-24-2003, 10:14 PM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re: file copying FFish code?!?

Code:
Shell.open(xxx.htm);
Reply With Quote
  #10 (permalink)  
Old 01-25-2003, 01:11 AM
Member
 
Join Date: Jan 2003
Posts: 56
Default Re: file copying FFish code?!?

wow, fast reply...
I'm currently using that in another part of my projector, although it's not what I'm really looking for, I'm looking for a popup window, it would be good if I could specify the size, without all the bar stuff at the top of the window like the back, forward, stop, address, file, edit, etc. buttons... I don't want them... I just want a simple popup window without all the 'stuff' of a normal window.

Is this possible with FFish?
Thanks!
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 02:49 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.