|
|||
|
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!!!! |
|
|||
|
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);
![]() |
|
|||
|
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 |
|
|||
|
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); *
![]() 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); *
|
|
|||
|
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 |
|
|||
|
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 |
|
|||
|
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);
|
|
|||
|
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! |
|
|||
|
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! |
![]() |
Was this information helpful? Yes No
| Thread Tools | |
| Display Modes | |
|
|