| Home | Tutorials | Forums | Articles | Blogs | Movies | Library | Employment | Press | Buy templates |
|
|
#1 |
|
Senior Member
Join Date: Mar 2007
Posts: 247
|
when ever I create a File inside a function in adds funciton Function() {} before and after my file path.
say I have this function: Code:
var tmpStr:String;
var tmpArr:Array;
function copyFile(file){
trace("Attempting to copy file");
var sourceFile:File = file;
trace("sourceFile:"+sourceFile);
tmpStr = file.url;
tmpArr = tmpStr.split("/");
tmpStr = tmpArr[tmpArr.length-1];
trace("new file:SideBarAssets/"+tmpStr);
var destination:File = File.desktopDirectory;
destination = destination.resolvePath("SideBarAssets/"+tmpStr);
trace("destination:"+destination);
try
{
sourceFile.copyTo(destination, true);
trace("copied file");
}
catch (error:Error)
{
trace("Error:"+error.message)
}
}
but since I defined this in a function instead I get a folder called function Function () {} on my desktop and inside that I get another folder called SideBarAssets inside that I get another folder with the name of what the file should be for instance myfile.jpg and inside that folder I get a file named function Function () {} very very strange
__________________
Visite my site: Altoona Design Last edited by halfasleeps; 03-12-2008 at 08:51 PM.. |
|
|
|
|
|
#2 |
|
Registered User
Join Date: Mar 2009
Posts: 2
|
Hello,
I'v got the same problem, somebody can help us ? Thank you ![]() |
|
|
|
|
|
|
|
|
#3 |
|
Registered User
Join Date: Mar 2009
Posts: 2
|
I found !
The code ActionScript Code:
was the problem. I replaced it by ActionScript Code:
I hope it helps you ![]() Good luck ! |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Flash and AIR | dbforch | AIR (Apollo) | 2 | 03-20-2008 05:27 AM |
| Adobe Air Security Issue?? | Ricardinho | AIR (Apollo) | 0 | 03-06-2008 10:23 AM |
| Integrating Flex, HTML, Javascript in AIR | glidealong | AIR (Apollo) | 1 | 02-13-2008 08:56 AM |
| I have a try to wirte code for a air war game, but I found a bug demond your help~ | greenidea | ActionScript 2.0 | 4 | 03-30-2007 04:40 AM |
| A flash 8 bug? | moopa | ActionScript 2.0 | 2 | 03-14-2007 03:01 AM |