Home Tutorials Forums Articles Blogs Movies Library Employment Press Buy templates

Go Back   ActionScript.org Forums > Desktop, Mobile and non-browser Environments > AIR (Apollo)

Reply
 
Thread Tools Rate Thread Display Modes
Old 03-12-2008, 08:49 PM   #1
halfasleeps
Senior Member
 
Join Date: Mar 2007
Posts: 247
Default I think I found an AIR bug.

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)
	}
}
this function should copy any file I pass to a folder on my desktop called "SideBarAssets".

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..
halfasleeps is offline   Reply With Quote
Old 03-03-2009, 05:20 PM   #2
Adysone
Registered User
 
Join Date: Mar 2009
Posts: 2
Default

Hello,

I'v got the same problem, somebody can help us ?

Thank you
Adysone is offline   Reply With Quote
Old 03-11-2009, 02:31 PM   #3
Adysone
Registered User
 
Join Date: Mar 2009
Posts: 2
Default

I found !

The code

ActionScript Code:
Array.prototype.in_array = function (needle) {     // ... }

was the problem.

I replaced it by

ActionScript Code:
function in_array(needle,array) {     // ... }

I hope it helps you

Good luck !
Adysone is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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

Forum Jump

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


All times are GMT. The time now is 09:04 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2009 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.